note 41291 added to function.show-source
| From: | em1x at dzwonki dot gsm dot pl | Date: | Mon, 05 Apr 2004 19:54:35 +0000 |
| Subject: | note 41291 added to function.show-source | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-67672@lists.php.net to get a copy of this message | ||
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;
}
?>
----
Manual Page -- http://www.php.net/manual/en/function.show-source.php
Edit -- http://master.php.net/manage/user-notes.php?action=edit+41291
Delete -- http://master.php.net/manage/user-notes.php?action=delete+41291&report=yes
Reject -- http://master.php.net/manage/user-notes.php?action=reject+41291&report=yes
Search -- http://master.php.net/manage/user-notes.php