note 32572 deleted from function.highlight-file by didou

From: Date: Sun, 27 Jul 2003 17:20:35 +0000
Subject: note 32572 deleted from function.highlight-file by didou
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-52775@lists.php.net to get a copy of this message
Note Submitter: tsunaquackHATESPAM ¤at¤ wp ¤d0T¤ pl ---- I have recently upgraded to php 4.3.2 and it seems that highlight_file now returns a single line without any LF (I mean \n) That would nicely fix it + display the line numbers using the right number of digits all the way and on-the-fly in an HTML table <table border="0"> <tr><td valign="top"><code> <?php ob_start(); highlight_file('THE_FILE_YOU_WANT_TO_HL.PHP'); $buffer = ob_get_contents(); ob_end_clean(); $buffer = str_replace('<br />', '<br />'."\n", $buffer); $nb = substr_count($buffer, "\n"); $l = strlen((string) $nb); for($i = 1; $i <= $nb; $i++) echo str_pad($i, $l, '0', STR_PAD_LEFT).':<br />'."\n" ?> </code></td> <td valign="top" nowrap><?php echo $buffer; ?></td> </table>

« previous php.notes (#52775) next »