php man page for highlight_string

Query: highlight_string

OS: php

Section: 3

Format: Original Unix Latex Style Formatted with HTML and a Horizontal Scroll Bar

HIGHLIGHT_STRING(3)							 1						       HIGHLIGHT_STRING(3)

highlight_string - Syntax highlighting of a string

SYNOPSIS
mixed highlight_string (string $str, [bool $return = false])
DESCRIPTION
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
o $str - The PHP code to be highlighted. This should include the opening tag. o $return - Set this parameter to TRUE to make this function return the highlighted code.
RETURN VALUES
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.
EXAMPLES
Example #1 highlight_string(3) example <?php highlight_string('<?php phpinfo(); ?>'); ?> The above example will output (in PHP 4): <code><font color="#000000"> <font color="#0000BB">&lt;?php phpinfo</font><font color="#007700">(); </font><font color="#0000BB">?&gt;</font> </font> </code> The above example will output (in PHP 5): <code><span style="color: #000000"> <span style="color: #0000BB">&lt;?php phpinfo</span><span style="color: #007700">(); </span><span style="color: #0000BB">?&gt;</span> </span> </code>
NOTES
Note When the $return parameter is used, this function uses internal output buffering so it cannot be used inside an ob_start(3) callback function. The HTML markup generated is subject to change.
SEE ALSO
highlight_file(3), Highlighting INI directives. PHP Documentation Group HIGHLIGHT_STRING(3)
Related Man Pages
imagestring(3) - php
extension_loaded(3) - php
highlight_file(3) - php
cairo_available_fonts(3) - php
highlight_string(3) - php
Similar Topics in the Unix Linux Community
How to change the font or color of text
help.. Problems in using awk
explain the code
php: Need little help in Coding
Color a Badge Based on the Weeks the Member is Active in the Latest Sequence