note 93247 deleted from function.highlight-string by danbrown
| From: | danbrown@php.net | Date: | Sun, 30 Aug 2009 18:49:03 +0000 |
| Subject: | note 93247 deleted from function.highlight-string by danbrown | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-160052@lists.php.net to get a copy of this message | ||
Note Submitter: bleakwind at gmail dot com
----
If you use line by line, it's the wrong way,use this:
<?php
// Bleakwind (www.weaverdream.com)
$file_content = file_get_contents("E:/www/test.php");
$file_content = highlight_string($file_content, "1");
// $file_content = highlight_file("E:/www/test.php", "1");
$file_count = count(explode("<br />", $file_content));
echo "<table cellpadding=\"1\" cellspacing=\"0\"
border=\"0\">";
echo "<tr>";
echo "<td bgcolor=\"#EEEEEE\" align=\"right\"
valign=\"top\">";
for ($i = 1; $i <= $file_count; $i++) {
echo $i."<br />";
}
echo "</td>";
echo "<td align=\"left\" valign=\"top\">";
echo $file_content;
echo "</td>";
echo "</tr>";
echo "</table>";
?>