Here is the simple php code to save the all images from html web page to server remotely :-

<?php

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

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

foreach ($tags as $tag) {
$img = $tag->getAttribute(‘src’);
$count_img++;
$a = explode(“?”,$img);
$image = $a[0];
$b = remoteImageUpload($image);
$my_img = “http://www.jaihindutva.com/post/”.$b;
$content = str_replace($img,$my_img,$content);

?>