Bug #18554 Updated: highlight_string
| From: | alan_k@php.net | Date: | Thu, 25 Jul 2002 02:50:06 +0000 |
| Subject: | Bug #18554 Updated: highlight_string | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-15116@lists.php.net to get a copy of this message | ||
ID: 18554
Updated by: alan_k@php.net
Reported By: yann@protonicdesign.com
-Status: Open
+Status: Won't fix
Bug Type: Feature/Change Request
Operating System: Linux
PHP Version: 4.1.2
New Comment:
changing to wont fix - as the ability is already available using the
tokenizer.
Previous Comments:
------------------------------------------------------------------------
[2002-07-24 22:47:50] alan@akbkhome.com
you can also use the tokenizer extension - the code for doing
highighlight_string type output can be derived from this.
http://docs.akbkhome.com/akpear/PHP_CodeDoc_Data.html#output_code
------------------------------------------------------------------------
[2002-07-24 22:06:46] msopacua@idg.nl
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]);
}
?>
------------------------------------------------------------------------
[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