The highlight_string() function outputs a string with the PHP syntax highlighted. The string is highlighted by using HTML tags.The colors used for highlighting can be set in the php.ini file or with the ini_set() function.
mixed highlight_string ( string $str [, bool $return = FALSE ] )
Outputs or returns html markup for a syntax highlighted version of the given PHP code using the colors defined in the built-in syntax highlighter for PHP.
Parameter | Description |
---|---|
str | Required. Specifies the string to highlight |
return | Set this parameter to TRUE to make this function return the highlighted code. |
If return is set to TRUE, returns the highlighted code as a string instead of printing it out. Otherwise, it will return TRUE on success, FALSE on failure.