get image from url, save it to disk and return a full url of the image
function getImage($url, $fileName) { $dir = 'images/'; $filename = $dir . $fileName; file_put_contents($filename, file_get_contents($url)); return $filename; } getImage('http://example.com/image.jpg', 'image.jpg');