Can anyone explain why this is happening.

I am using the following code For giving code examples on my website with syntax highlighting

$text = '<?php \$my_code = "echo 'text text text text'; \$foo = 'bar';"; example_function(\$my_code); ?&gt';
$body = preg_replace('/&lt;(.*?)&gt;/es', 'highlight_string("<\\1>", true)', $text);
echo $body; //Returns: <?php = 'echo \'text text text text\'\'; = \'bar\'; highlight_string(, true); ?> //I want: <?php $my_code = "echo 'text text text text'; $foo = 'bar';"; example_function($my_code); ?>


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Reply via email to