note 71454 deleted from function.preg-replace by colder
| From: | colder@php.net | Date: | Mon, 18 Jun 2007 20:06:22 +0000 |
| Subject: | note 71454 deleted from function.preg-replace by colder | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-127711@lists.php.net to get a copy of this message | ||
Note Submitter: neuroxik DOT com
----
To Magikx:
You don't need preg_replace to achieve what you want, I'll show you right after, but your
error is you forgot to put the subject string at the end, as says the manual, like this:
$text=preg_replace('0','<img src=images/num1/0.gif>',$text);
Now I said you don't need preg_replace, just look at what you're replacing: numbers and
letters, so why not just directly insert them in the img tags, thus saving time, space AND
processing:
print "<img src=images/num1/". $text .".gif>";