1
2
3
4
5
6
7
<?php
function getRemoteImageToTemp($url){
    $fp = file_get_contents($url);
    $tmp = tempnam('/tmp/','url_image');
    file_put_contents($tmp,$fp);
    return $tmp;
}