Monday, January 28, 2013

DOMXPath Read Using PHP

<?php

$url=”http://www.yoururl.com&#8221;;

$html = file_get_contents($url);

$doc = new DOMDocument();
@$doc->loadHTML($html);

$tags = $doc->getElementsByTagName(‘img’);

foreach ($tags as $tag) {
echo $tag->getAttribute(‘img’);
}

?>

No comments:

Post a Comment