note 79547 added to function.highlight-file
| From: | Cathy at osu1 dot php dot net | Date: | Sun, 02 Dec 2007 19:32:39 +0000 |
| Subject: | note 79547 added to function.highlight-file | ||
| Groups: | php.notes php.notes | ||
| Request: | Send a blank email to php-notes+get-132751@lists.php.net to get a copy of this message | ||
Here is my printable version of line numbering (no floats). It also wraps lines correctly,
preserving the original numbering.
.num {
width: 22px;
color: #777;
text-align: right;
margin-right: 3px;
padding-right: 3px;
border-right: 1px solid #777;
}
<?php
function highlight_num($file) {
$lines = explode("<br />", highlight_file($file, true));
foreach ($lines as $line_num => $line)
$output .= "<br /><code class=\"num\">" . ($line_num + 1) .
"</code>" . $line;
echo $output;
}
?>
----
Server IP: 69.147.83.197
Probable Submitter: 75.49.37.248
----
Manual Page -- http://www.php.net/manual/en/function.highlight-file.php
Edit -- https://master.php.net/note/edit/79547
Del: integrated -- https://master.php.net/note/delete/79547/integrated
Del: useless -- https://master.php.net/note/delete/79547/useless
Del: bad code -- https://master.php.net/note/delete/79547/bad+code
Del: spam -- https://master.php.net/note/delete/79547/spam
Del: non-english -- https://master.php.net/note/delete/79547/non-english
Del: in docs -- https://master.php.net/note/delete/79547/in+docs
Del: other reasons-- https://master.php.net/note/delete/79547
Reject -- https://master.php.net/note/reject/79547
Search -- https://master.php.net/manage/user-notes.php