function zamien($text) { '#tabela-wynik;' => 'wstaw wynik', '#tabela-ostatnie;' => 'wstaw ostatnie', '#tabela-nowe;' => 'wstaw nowe'); return $text; }
Czy jest w ogóle sposób na tego typu podmianę? Może taka operacja ma swoją nazwę?
function zamien($text) { '#tabela-wynik;' => 'wstaw wynik', '#tabela-ostatnie;' => 'wstaw ostatnie', '#tabela-nowe;' => 'wstaw nowe'); return $text; }
function zamien($text) { '#tabela-wynik;' => 'footer.php', '#tabela-ostatnie;' => 'wstaw ostatnie', '#tabela-nowe;' => 'wstaw nowe'); include $e['#tabela-wynik;']; return $text; } $art = 'ojej #tabela-wynik;';
<?php $tekst ="jakiś napis<br>#tabela-wynik;"; function zamiana($tekst){ '#tabela-wynik;' => 'wynik.php', '#tabela-ostatnie;' => 'ostatnie.php', '#tabela-nowe;' => 'nowe.php' ); foreach($e as $key => $value){ if(mb_strpos($tekst,$key)!==false){ include_once $value; } } } ?>
class Theme{ public $theme; public $tpl; public $data; public $tr; public function __construct($theme) { $this->theme = $theme; //$this->tr = Array(); } //end construct(); public function add($name, $value='') { { //var_dump($name); foreach($name as $key => $value) { if(mb_strpos($this->tpl,$key)!==false) { include_once 'ns-include/'.$value; } }// end foreach(); } } //end add(); public function execute() { //echo $this->tpl; } //end execute(); }//end class Theme
$view = new Theme('test'); '#nawigacja;' => 'nav.php', '#tabela-ostatnie;' => 'nav3.php' ); $view-> add($data);