note 38504 rejected from function.preg-replace by nlopess
| From: | nlopess@php.net | Date: | Wed, 24 Dec 2003 17:44:57 +0000 |
| Subject: | note 38504 rejected from function.preg-replace by nlopess | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-62429@lists.php.net to get a copy of this message | ||
Note Submitter: spam@websaait.nl
----
function php_highlight($input)
{
$output = "<br><table cellspacing=0 cellpadding=0 border=0 width=100%>
<tr><td width=40><td class=date>PHP</td></tr> <tr><td
height=1><td bgcolor=808080 height=1></tr> <tr><td><td align=left
valign=top>";
ob_start();
highlight_string($input);
$output .= ob_get_contents();
ob_end_clean();
$output .= "</tr> <tr><td height=1><td bgcolor=808080
height=1></tr> </table><p>";
return $output;
}
$msg = preg_replace ("/\[php\]((.|\n)*?)\[\/php\]/e",
'php_highlight("\\1")', $msg);
Does anyone know how to adept this so the variabels will not disappear?