Hi,
My website needs to allow users to specify where a thumbnail image will
appear in the text ($articleText) they submit.
The thumbnail filenames are held in a single-dimensional array called
$photos
e.g. the users are to type [thumb4] to specify they want thumbnail four (
from array position 4 )
I was hoping the following expression would work, but it doesn't. The
returned text always includes <img src="thumbs/"> i.e. no image filename is
inserted. (I was expecting something like <img src="thumbs/dave.jpg"> )
$articleText = preg_replace("/\[thumb(\d+)\]/", "<img
src=\"thumbs/".$photos[$1]."\">", $articleText);
Can anyone help please?
Thanks,
--
Sorby