I'm really not sure how better to explain it. I am trying to return the whole img tag (that means from the opening < to the closing >) if said tag has has no alt tag in it. So here is some code to explain.
<?php
$text='Here is some <img src="an_image.jpg" width="100" alt="none really" height="20" /> text and <img src="another_image.jpg" width="30" height="10" /> some images';
$regex1='regex goes here';
echo(preg_replace($regex1,"\${1} alt="" />",$text);
?>
And what would be echoed would be
Here is some <img src="an_image.jpg" width="100" alt="none really" height="20" /> text and <img src="another_image.jpg" width="30" height="10" alt="" /> some images
See?
I'm trying to make the site more XHTML compliant and one of the requirements is that all img tags have alt text.
Thanks
Bubble