<?php function php($kod) { } $php = 'function cos() { echo 'witaj'; }'; php($php); ?>
jak zmienie echo na returnw funkcji php nic nie wyswietla
<?php function php($kod) { } $php = '<?php function cos() { echo 'witaj'; }?>'; php($php); ?>
function ColorCode(&$text){ $code_o = explode("php", $text); $text = $code_o[0]; for($i=1; $i < count($code_o); $i++){ $code_c = explode("/php", $code_o[$i]); $code_c[0] = stripslashes($code_c[0]); if(!eregi("<\?", $code_c[0])){ $code_c[0]="<?php\n".$code_c[0]; $del_php=true; } $code_c[0] = Hl($code_c[0]); $text .= '<br /><p style="font-size: 12px; margin: 4px; border: 1px black solid; padding: 5px;">'.$code_c[0]."</P>".$code_c[1]; } return $text; } function Hl($code){ return $code; } ?>
<?php if ( $e == $id ) { ColorCode($text); echo "<table style=\"width: 532px\"><tr><td style=\"background: url(Obrazki/belka_news.gif); height: 20px\">".$topic."</td></tr> <tr><td>".$text."</td></tr></table>"; } } ?>
<?php function Hl($code){ } ?>
<?php function phpcode($code) { { $code = ' <?php '.$code.''; } { $code = ' <?php '.$code.''; } { $code .= ' ?>'; } } function bbc($str) { } ?>
<?php ?>
<?php function phpcode($str) { { $str = ' <?php '.$str.''; } { $str = ' <?php '.$str.''; } { $str .= ' ?>'; } } ?>
<?php ?>
<?php ?>
<?php function phpcode($str) { { $str[1] = ' <?php '.$str.''; } { $str[1] = ' <?php '.$str.''; } { $str[1] .= ' ?>'; } } function bbc($str) { $str = preg_replace("#\[color=(.*?)\](.*?)\[/color\]#si", "<span style=\"color:\\1\">\\2</span>", $str); $str = preg_replace("#\[size=(.*?)\](.*?)\[/size\]#si", "<span style=\"font-size:\\1\">\\2</span>", $str); $str = preg_replace("#\[code\](.*?)\[/code\]#si", "<table><tr><td class=\"codetitle\"><b>Kod:</b></td></tr><tr><td class=\"codetext\">\\1</td></tr></table>", $str); $str = preg_replace("#\[quote\](.*?)\[/quote\]#si", "<table><tr><td class=\"quotetitle\"><b>Cytat:</b></td></tr><tr><td class=\"quotetext\">\\1</td></tr></table>", $str); $str = preg_replace("#\[email=(.*?)@(.*?)\](.*?)\[/email\]#i", "<a href=\"mailto:\\1@\\2\">\\3</a>", $str); $str = preg_replace("#\[url=(.*?)](.*?)\[/url\]#si", "<a href=\"\\1\" target=\"_blank\">\\2</a>", $str); } $text = '[php\]<?php echo "cos"; ?>[/php\]'; bbc($text); ?>
function phpcode($arr){ // tak jak mowilem, nie bedziesz mial tu stringu tylko tablice! $str = $arr[1]; // ni jestem pewien czy ta wiec sprawdz sobie! print_r( $arr ); if(substr($str[1], 0, 2) !== '<?' ) { $str[1] = ' <?php '.$str.''; } else if(substr($str[1], 0, 5) != '<?php') { $str[1] = ' <?php '.$str.''; } if(substr($str[1], -2) != '?>') { $str[1] .= ' ?>'; } echo $str[1]; }
<?php return $str; // return nie echo! } ?>
<?php ?>
<?php $text = '[php\]echo "cos";[/php\]'; ?>
<?php ?>