note 45287 deleted from function.highlight-string by aidan
| From: | aidan@php.net | Date: | Wed, 01 Sep 2004 06:38:00 +0000 |
| Subject: | note 45287 deleted from function.highlight-string by aidan | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-75820@lists.php.net to get a copy of this message | ||
Note Submitter: admin at mtrow dot dk
----
A simple way to highlight only <?php to ?> in a mysql $row
<?php
$message = $row[message];
function hilite($matches) {
$ret = highlight_string($matches[1], true);
return $ret; }
$message = preg_replace_callback("/(<\?php.*?\?>)/ms", 'hilite',
$message);
echo $message;
}
?>