Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
<?php
$html = file_get_contents('http://venugopalphp.wordrpess.com');
$dom = new domDocument;
@$dom->loadHTML($html);
$dom->preserveWhiteSpace = false;
$images = $dom->getElementsByTagName('img');
$i=0;
foreach ($images as $image) {
echo '<img src='.$image->getAttribute('src').'>';
}
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment