note 42181 added to function.highlight-string

From: Date: Thu, 06 May 2004 16:30:47 +0000
Subject: note 42181 added to function.highlight-string
Groups: php.notes 
Request: Send a blank email to php-notes+get-69283@lists.php.net to get a copy of this message
Didn't get Malcolm's line numbering to work properly, so I made my own function. <?php function highlight_php($string) { $string = stripslashes($string); $string = highlight_string($string, true); $arr = explode("<br />", $string); $start = "<table width=1000 cellpadding=0 cellspacing=0 border=0>\n"; for ($i=0; $i<count($arr); $i++) { $output .= "<tr><td valign=top bgcolor=\"#f0f0f0\">".($i+1)."</td><td valign=top style=\"padding-left: 5px;\">$arr[$i]</td></tr>\n"; } $end = "</table>\n"; return $start . $output . $end; } ?> ---- Manual Page -- http://www.php.net/manual/en/function.highlight-string.php Edit -- http://master.php.net/manage/user-notes.php?action=edit+42181 Delete -- http://master.php.net/manage/user-notes.php?action=delete+42181&report=yes Reject -- http://master.php.net/manage/user-notes.php?action=reject+42181&report=yes Search -- http://master.php.net/manage/user-notes.php

« previous php.notes (#69283) next »