|
highlight_stringSyntax highlighting of a string Description
stringtrue highlight_string(string
$string , 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. Parameters
Return Values
If Changelog
Examples
Example #1 highlight_string example
The above example will output: <code><span style="color: #000000"> <span style="color: #0000BB"><?php phpinfo</span><span style="color: #007700">(); </span><span style="color: #0000BB">?></span> </span> </code> Output of the above example in PHP 8.3: <pre><code style="color: #000000"><span style="color: #0000BB"><?php phpinfo</span><span style="color: #007700">(); </span><span style="color: #0000BB">?></span></code></pre> Notes
The HTML markup generated is subject to change. |