Created
August 5, 2013 05:13
-
-
Save vmunhoz/6153657 to your computer and use it in GitHub Desktop.
Using DOM objects PHP
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$doc = new DOMDocument(); | |
$doc->loadHTML('<img src="http://example.com/img/image.jpg" ... />'); | |
$imageTags = $doc->getElementsByTagName('img'); | |
foreach($imageTags as $tag) { | |
echo $tag->getAttribute('src'); | |
} | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment