ID:          15650
 Updated by:  [EMAIL PROTECTED]
 Reported By: [EMAIL PROTECTED]
-Status:      Closed
+Status:      Analyzed
-Bug Type:    Feature/Change Request
+Bug Type:    Documentation problem
 PHP Version: 4.1.1
 New Comment:

Not so fast, Derick actually did this already in CVS:

ChangeLog:
- Added optional parameter to highlight_string and highlight_file which
makes these functions return a highlighted string instead of dumping to
standard output. 


It's just not documented at all.

--Jani



Previous Comments:
------------------------------------------------------------------------

[2002-02-20 18:04:35] [EMAIL PROTECTED]

ob_start();
highlight_string($str);
$ob = ob_get_contents();
ob_end_clean();

wrap this in a function.



------------------------------------------------------------------------

[2002-02-20 17:57:54] [EMAIL PROTECTED]

At  this moment (php4.1.1) the function "highlight_string" has the
following
syntax:


[quote]
bool highlight_string ( string str)
This function prints out a syntax highlighted version of str using the
colors defined in the built-in syntax highlighter for PHP. Returns TRUE
or
FALSE.
[/quote]



The function will be more flexible if it returns a string (with
highlights)
and nothing is printed directly. 

str highlight_string ( string str)
This function returns a string containing a syntax highted version of
str
using the colors defined in the built-in syntax highlighter for PHP.
Returnes a string with syntax-highlighted html

Reference: http://lxr.php.net/source/ZendEngine2/zend_highlight.c#84


------------------------------------------------------------------------


-- 
Edit this bug report at http://bugs.php.net/?id=15650&edit=1

Reply via email to