You are here: Regular Expression to extract all .JPG and .PNG URL's « PHP Programming Language « IT news, forums, messages
Regular Expression to extract all .JPG and .PNG URL's

Posted by kosanovic on 10/12/07 15:12

Hello,
I'm bad at regular expressions. Would somebody help me:
I need to extract all URL to .jpg and .png pictures from a string
containing an HTML file (DOM wouldn't work well in what I need).

I've tried:

preg_match_all("/.jpg$|.png$/", $htmlfile, $Matches);
foreach ($Matches as $match)
{
echo $match."<br>";
}

without much success. Anybody can correct this to make it work?

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация