note 113249 added to function.highlight-string
| From: | joshuaeasy4u at gmail dot com | Date: | Tue, 17 Sep 2013 21:19:37 +0000 |
| Subject: | note 113249 added to function.highlight-string | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-196283@lists.php.net to get a copy of this message | ||
<?php
function printCode($source_code)
{
if ( is_array($source_code))
return false;
$source_code=explode("\n",str_replace(array("\r\n","\r"),"\n",$source_code));
$line_count=1;
foreach ( $source_code as $code_line)
{
$formatted_code .='<tr><td>'.$line_count.'</td>';
$line_count++;
if ( ereg('<\?(php)?[^[:graph:]]',$code_line))
$formatted_code.='<td>'.str_replace(array('<code>','</code>'),'',highlight_string($code_line,true)).'</td></tr>';
else
$formatted_code
.='<td>'.ereg_replace('(<\?php )+','',str_replace(array('<code>','</code>'),'',highlight_string('<?php
'.$code_line,true))).'</td></tr>';
}
return '<table style="font: 1em Consolas, \'andale mono\', \'
monotype.com\', \'lucida console\',
monospace;">'.$formatted_code.'</table>';
}
?>
----
Server IP: 69.147.83.199
Probable Submitter: 192.151.242.169 (proxied: 41.190.3.119)
----
Manual Page -- http://php.net/manual/en/function.highlight-string.php
Edit -- https://master.php.net/note/edit/113249
Del: integrated -- https://master.php.net/note/delete/113249/integrated
Del: useless -- https://master.php.net/note/delete/113249/useless
Del: bad code -- https://master.php.net/note/delete/113249/bad+code
Del: spam -- https://master.php.net/note/delete/113249/spam
Del: non-english -- https://master.php.net/note/delete/113249/non-english
Del: in docs -- https://master.php.net/note/delete/113249/in+docs
Del: other reasons-- https://master.php.net/note/delete/113249
Reject -- https://master.php.net/note/reject/113249
Search -- https://master.php.net/manage/user-notes.php