RE: [PHP] Grabbing image information from an html string
| From: | Dan Rossi | Date: | Tue, 25 Mar 2003 19:39:11 +0000 |
| Subject: | RE: [PHP] Grabbing image information from an html string | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-141007@lists.php.net to get a copy of this message | ||
if (preg_match('/(href|HREF)="?(\S+\.(jpg|png))">?/',$line, $matches)){
$filename[] = $matches[2];
}
-----Original Message-----
From: Luis Lebron [mailto:llebron@sigmainteractive.com]
Sent: Wednesday, March 26, 2003 7:07 AM
To: Php-General (E-mail)
Subject: [PHP] Grabbing image information from an html string
Let say I have an html string that looks like this:
<b>Title<b>
<img src="graphics/image1.jpg">foo bar bar foo<img
src="graphics/image2.jpg">Some more text.
I would like to pull the image filenames from the html and end up with
something like this
$images=array("image1.jpg", "image2.jpg")
How can I do this?
thanks,
Luis R. Lebron
Project Manager
Sigmatech, Inc