highlight_string
Syntax highlighting of a string
Description
mixedhighlight_string
stringstr
boolreturn
The highlight_string function outputs a syntax
highlighted version of str using the colors defined
in the built-in syntax highlighter for PHP.
If the second parameter return is set to &true;
then highlight_string will return the highlighted
code as a string instead of printing it out. If the second parameter is
not set to &true; then highlight_string will
return &true; on success, &false; on failure.
highlight_string example
');
?>
]]>
The above example will output (in PHP 4):
<?php phpinfo(); ?>
]]>
The above example will output (in PHP 5):
<?php phpinfo(); ?>
]]>
The return parameter became available in PHP
4.2.0. Before this time it behaved like the default, which is &false;
See also highlight_file.