Can anybody tell me, how can I get image for a particular site by its url only? As that is done on the google search page. I have searched web but I didn\'t get any satisfactory
Get the page with file_get_contents($url)
then you can parse the content and download the images and store it at your server:
$url = 'http://example.com/image.php';
$img = '/my/folder/flower.gif';
file_put_contents($img, file_get_contents($url));
See this related Question.
Update: To get the image you could use SimpleXMLElement:
$obj = new SimpleXMLElement($htmlCode);
$url = $obj->body->img->src;