September 2001
Intermediate to advanced
768 pages
32h 45m
English
bool highlight_string(string code_snippet) Applies PHP syntax highlight to a string.
Returns:
TRUE on success; FALSE on failure
Description:
highlight_string() is used to apply PHP syntax highlighting to a string and then display it. The syntax highlighting is applied using HTML tags. The function returns TRUE on success and FALSE on failure.
The colors used for highlighting can be set in the php.ini file. They can also be set using the ini_set() function; see highlight_file() for an example.
Note:
The string passed should contain PHP code block start and end tags if it is to be properly highlighted; for example, 'printf ("%0.2d", 0x2)' will not be highlighted, while '<?php printf ("%0.2d", 0x2) ?>' will be highlighted.
Read now
Unlock full access