note 41291 deleted from function.show-source by aidan
| From: | aidan@php.net | Date: | Sun, 26 Sep 2004 14:10:23 +0000 |
| Subject: | note 41291 deleted from function.show-source by aidan | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-77390@lists.php.net to get a copy of this message | ||
Note Submitter: em1x at dzwonki dot gsm dot pl
----
Here's a small code that write line numbers and keeps the colouring of the show_sorce function
<?php
function show_file($file)
{
$code = show_source($file,true);
$kod = "<table cellpadding=\"0\" cellspacing=\"0\">";
$lines = count(file($file));
for ($i=1; $i<=$lines; $i++)
{
$kod .= "<tr><td align=\"center\" width=\"20\"
style=\"font: 8pt Tahoma\">";
$kod .= ($i==1) ?
"1</td><td valign=\"top\"
rowspan=\"".$lines."\">".$code."</td></tr>" :
"$i</td></tr>";
}
$kod .= "</table>";
return $kod;
}
?>