highlight_string

(PHP 4 >= 4.0b1)

highlight_string -- Syntax highlighting of a string

Description

bool highlight_string (string str)

The highlight_string() function prints out a syntax highlighted version of str using the colors defined in the built-in syntax highlighter for PHP. Returns TRUE on succes, FALSE on failure.

Tip: As with anything that outputs its result directly to the browser, you can use the output-control functions to capture the output of this function, and save it - for example - in a string.

See also highlight_file(), show_source().