Bug #15650 Updated: function highlight_string() returns string

From: Date: Wed, 27 Feb 2002 14:08:16 +0000
Subject: Bug #15650 Updated: function highlight_string() returns string
References: 1  Groups: php.bugs php.doc 
Request: Send a blank email to php-bugs+get-1205@lists.php.net to get a copy of this message
ID: 15650 Updated by: sander@php.net Reported By: rein@velt.net -Status: Analyzed +Status: Closed Bug Type: Documentation problem PHP Version: 4.1.1 New Comment: This bug has been fixed in CVS. Previous Comments: ------------------------------------------------------------------------ [2002-02-20 18:57:19] sniper@php.net 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 ------------------------------------------------------------------------ [2002-02-20 18:04:35] cynic@php.net ob_start(); highlight_string($str); $ob = ob_get_contents(); ob_end_clean(); wrap this in a function. ------------------------------------------------------------------------ [2002-02-20 17:57:54] rein@velt.net 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

« previous php.bugs (#1205) next »