note 27112 deleted from function.highlight-file by aidan
| From: | aidan@php.net | Date: | Sun, 26 Sep 2004 13:57:47 +0000 |
| Subject: | note 27112 deleted from function.highlight-file by aidan | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-77385@lists.php.net to get a copy of this message | ||
Note Submitter: pingjuNOSPAM at stud dot ntnu dot NO_SPAM dot no
----
I use this code to view the source with line numbers, it is quite simple, only 5 line if the part
for file information display excluded.
$content = highlight_file($file, TRUE);
$Lines = substr_count($content, "<br />") + 1;
$SizeofFile = number_format(filesize($file), 0, ' ', ' ');
$lastModified = date( "F d Y H:i:s.", filemtime($file));
echo "<div align=center>", $file, " has ", $Lines, " lines, size
is ", $SizeofFile, " bytes, last modified on ", $lastModified,
"</div>";
$content =ereg_replace("<br />",
"</code></li><li><code>", $content);
echo "<ol><li>";
print_r ($content);
echo "</ol>";