note 3394 deleted from function.ereg-replace by jimw
| From: | jimw@php.net | Date: | Fri, 02 Nov 2001 01:42:03 +0000 |
| Subject: | note 3394 deleted from function.ereg-replace by jimw | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-20175@lists.php.net to get a copy of this message | ||
to convert "*blabla*" to "<b>blabla</b>", use this:
$newstring = ereg_replace("\\*([^*]*)\\*", "<b>\\1</b>", $string);
note the necessary double escaping of the literal asterisk (\\*)