Jump to content

code block


dustinnoe

Recommended Posts

Try using Preg_replace finding quote marks etc and adding the HTML tags around them for colour.

 

Ie

<?PHP

$subject 'echo "This is a test echo";';

$code[0] = "|\"(.*?)\"|s";

$code_replace[0] = "<font color=\"#ff4400\">\"$1\"</font>";

$replaced = preg_replace( $code, $code_replace, $subject );

?>

 

You'd have to populate the $code array with all the keywords and function names and the $code_replace array with the HTML you want them surrounded it.

 

Cold

Link to comment
https://forums.phpfreaks.com/topic/39738-code-block/#findComment-191861
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.