0

Hi I want to get all images from a website and store it on MySQL using PHP I am using HTML dom its showing me an error please help me here is this error

Warning: DOMDocument::loadHTML(): htmlParseEntityRef: expecting ';' in Entity, line: 73 in C:\xampp\htdocs\Oifind\Formula.php on line 3

and here is my code

<?php 
$html = file_get_contents('http://www.google.com/');
$dom = new domDocument;
$dom->loadHTML($html);
$dom->preserveWhiteSpace = false;
$images = $dom->getElementsByTagName('img');
foreach ($images as $image) {
    $src= $image->getAttribute('src');
    echo "<img src='".$src."'>";
}
?>
RiggsFolly
  • 93,638
  • 21
  • 103
  • 149
Joytiarjun
  • 16
  • 3

0 Answers0