-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1
did you post the same message 7 times?
try: <? $subject = '<img src="THIS12BIT.ext">'; $pattern = '/<img[\s]+?src=[\'"](.+?)[\'"].*?>/i';
$matchFound = preg_match_all ($pattern, $subject, $matches, PREG_SET_ORDER);
print_r($matches); //$matches[$i][1] is what really matters ?>
that pattern may not be the best regex to use, but i think it works for most cases
Pete M wrote:
Im trying to scan a file and lift the image name from the <img tag
ie <img src="THISBIT.ext"> where there could be ' or "
I messed around but am 2 embarassed to post code cos it dont work ;-(
thanks in advance
pete
-----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.4 (MingW32) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
iD8DBQFALXUxaxdA/5C8vH8RAtlAAKDUHsfEXVlKDZJRAg0I22rtpJxmsQCgjmze xBmlxQW6SbHMaHV+A/dGydA= =uxyA -----END PGP SIGNATURE-----
-- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php