|
Posted by Captain Paralytic on 10/12/07 15:28
On 12 Oct, 16:12, kosano...@gmail.com wrote:
> 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?
Try:
preg_match_all("/.*(jpg|png)$/", $htmlfile, $Matches);
Navigation:
[Reply to this message]
|