Jump to content

[SOLVED] PHP Color Function


Foser

Recommended Posts

Check out the highlight_string() function. Notice especially the second parameter. If it is set to TRUE, the colored string is returned, but if it is not, it is automatically output to the screen.

 

<?php
$string = "<?php echo \"Hello, World!\"; ?>";
$out = highlight_string($string, TRUE);
echo $string;
?>

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.