hey,
i'm trying to convert some special combination to images...
it's my first time i'm try to use regular expressions...
for example, assume that the var $txt contain this:
Code:
<p>
sad <{img_2}> asd
</p>
i want the output will be 2
i want all the content that comes before and after the number 2 will removed...
and its important to me to replace the "<" and ">" with "<" and ">"
i tried this:
Code:
$img_id = preg_replace("/^(.+?)\<{img_(.+?)\}>(.+?)\$/", "\\2", $txt );
but its wont work!
thanks!
***sorry for poor english***
|