note 27494 added to function.highlight-file
| From: | rakkis at madqon dot org | Date: | Sun, 08 Dec 2002 10:46:25 +0000 |
| Subject: | note 27494 added to function.highlight-file | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-40524@lists.php.net to get a copy of this message | ||
The line-numbering examples above didn't work so well for me (they always left too much space
beetween the lines or made some other obscure cruft on the top/bottom of the output) so here is one
I made up:
$contents = highlight_file($filename, true);
$contents = explode("<br />", $contents);
$ln = 1;
foreach($contents as $line) {
print "<font color=\"#000000\">$ln:</font> $line<br>";
$ln++;
}
--
http://www.php.net/manual/en/function.highlight-file.php
http://master.php.net/manage/user-notes.php?action=edit+27494
http://master.php.net/manage/user-notes.php?action=delete+27494
http://master.php.net/manage/user-notes.php?action=reject+27494