note 74018 modified in function.highlight-file by bobby

From: Date: Thu, 22 Mar 2007 14:41:16 +0000
Subject: note 74018 modified in function.highlight-file by bobby
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-124716@lists.php.net to get a copy of this message
Here's a better take at highlighting a file with line numbers: <style type="text/css"> .num { float: left; color: gray; text-align: right; margin-right: 6pt; padding-right: 6pt; border-right: 1px solid gray;} </style> <?php function highlight_num($file) { echo '<code class="num">', implode(range(1, count(file($file))), '<br />'), '</code>'; highlight_file($file); } highlight_num('file.php'); ?> Thanks for the implode() part from Arevos at programmingforums.org --was-- Here's a better take at highlighting a file with line numbers: <?php function highlight_num($file) { echo '<code class="num">', implode(range(1, count(file($file))), '<br />'), '</code>'; highlight_file($file); } ?> along with the appropriate css Thanks for the implode() part from Arevos at programmingforums.org http://php.net/manual/en/function.highlight-file.php

« previous php.notes (#124716) next »