Bug #18554 Updated: highlight_string

From: Date: Thu, 25 Jul 2002 02:06:46 +0000
Subject: Bug #18554 Updated: highlight_string
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-15113@lists.php.net to get a copy of this message
ID: 18554 Updated by: msopacua@idg.nl Reported By: yann@protonicdesign.com Status: Open Bug Type: Feature/Change Request Operating System: Linux PHP Version: 4.1.2 New Comment: Hi, highlight_* functions only highlight php code, because php code can be mixed with normal text or HTML. That said, I like the feature request, like so: highlight_string(string $source, bool $show_linenumbers) FYI, it can be done like so: <?php ob_start(); highlight_string($source); $out = ob_get_contents(); ob_end_clean(); $lines = explode("<br />", $out); for($i=0; $i<count($lines);$i++) { //needs tweaking of the font colors/tags printf("%03d: %s<br />", $i+1, $lines[$i]); } ?> Previous Comments: ------------------------------------------------------------------------ [2002-07-24 21:41:48] yann@protonicdesign.com According to me highlight_string should allow you to highlight a string that does not necessairly start with <?php or <? For the simple reason, that i want to read a file, line by line to return the line number, then the code. Or there should be a feature in highlight_file so that it returns line numbers. It is a details but it could be usefull. ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=18554&edit=1

« previous php.bugs (#15113) next »