Forum Moderators: coopster
I have a directory with a bunch of files in it (images). What I want to do is have PHP replace all the tags that look something like
[hi.gif]
with
<img src="emoticons/hi.gif">
but ONLY if the file exists. How could I do the replacement?
Is there some way to reference to a certain grouping of regex stuff, like in perl? ($1)
Please respond ASAP.
$string = preg_replace("/(\[.{1,}\])/g","checkimg($1)",$string);