Php - Error php file get contents no images, File_get_contents does not display images


Error php file get contents no images

Some times file_get_contents($url) will not display images in the $url.
This below code rectifies the issue.
<?php
 $URL = "http://www.indiandir.com/addurl.php";
 $domain = file_get_contents($URL);
 if($domain !== FALSE)
 {
  $domain = preg_replace('/<head>/i', "<head>\n<base href='$URL'>\n", $domain);
  echo $domain;
 } 
?>

Php - File_get_contents does not display images
The topic on Php - Error php file get contents no images is posted by - Mallu
Hope you have enjoyed, Php - Error php file get contents no images . Thanks for your time.

All rights reserved. © www.w3calculator.com