note 78754 added to function.highlight-string

From: Date: Thu, 25 Oct 2007 23:10:17 +0000
Subject: note 78754 added to function.highlight-string
Groups: php.notes 
Request: Send a blank email to php-notes+get-131742@lists.php.net to get a copy of this message
This is an addition to dark_messenger84's highlight script. I added a line to make the script allow blank lines in code. <?php function print_php_code($str, $type) { switch ($type) { case "text": $str = highlight_string($str, true); break; case "file": $str = highlight_file($str, true); break; } $str = explode("<br />", $str); echo "<div>"; echo "<ol>\n"; foreach ($str as $line => $syntax) { $syntax = (strlen($syntax) >1) ? $syntax : "&nbsp;"; echo "<li><code>" . $syntax . "</code></li>"; } echo "</ol>\n"; echo "</div>"; } ?> ---- Server IP: 209.41.74.194 Probable Submitter: 24.113.130.206 ---- Manual Page -- http://www.php.net/manual/en/function.highlight-string.php Edit -- https://master.php.net/note/edit/78754 Del: integrated -- https://master.php.net/note/delete/78754/integrated Del: useless -- https://master.php.net/note/delete/78754/useless Del: bad code -- https://master.php.net/note/delete/78754/bad+code Del: spam -- https://master.php.net/note/delete/78754/spam Del: non-english -- https://master.php.net/note/delete/78754/non-english Del: in docs -- https://master.php.net/note/delete/78754/in+docs Del: other reasons-- https://master.php.net/note/delete/78754 Reject -- https://master.php.net/note/reject/78754 Search -- https://master.php.net/manage/user-notes.php

« previous php.notes (#131742) next »