On Saturday 14 February 2004 02:25, 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 ;-(
It's always better to post something no matter how bad you may think it is. It shows that you have at least tried to solve your own problem and are not merely trying to earn your keep by asking others to do your work for you. Here's something to get you started: $doo[1] = '<img src="dah.jpg">'; $doo[2] = "<img src='doo.jpg'>"; foreach ($doo as $dah) { if (preg_match('/<img src=["|\'](.*)\.(.*)["|\']>/i', $dah, $matches)) { print_r($matches); } } You may want to refine it so that it will recognise less than perfectly formed <img> tags. -- Jason Wong -> Gremlins Associates -> www.gremlins.biz Open Source Software Systems Integrators * Web Design & Hosting * Internet & Intranet Applications Development * ------------------------------------------ Search the list archives before you post http://marc.theaimsgroup.com/?l=php-general ------------------------------------------ /* Knowledge, sir, should be free to all! -- Harry Mudd, "I, Mudd", stardate 4513.3 */ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php