- file_get_contents: documentation ( source)
<?php
$url = 'http://stackoverflow.com/questions/7994340/how-can-i-get-image-from-url-in-php-or-jquery-or-in-both';
$data = file_get_contents($url);
$dom = new DOMDocument;
$dom->loadHTML($data);
$img = $dom->getElementsByTagName('img');
foreach($img as $x){
echo $x->src;
}