0
function getFacebookPhoto($img,$fullpath) {

$curl = curl_init();
curl_setopt($curl, CURLOPT_FOLLOWLOCATION, true);
curl_setopt($curl, CURLOPT_URL, $img);
curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($curl, CURLOPT_CONNECTTIMEOUT, 0);
$user_curl_image = curl_exec($curl);
curl_close($curl);

if(file_exists($fullpath)){
    @unlink($fullpath);
}
$fp = fopen($fullpath,'x');
fwrite($fp, $user_curl_image);
fclose($fp); 
}

これは、写真をダウンロードするために使用するスクリプトです。それは正しい方法ですか?

Facebookアプリ内でこの関数を使用します。

4

0 に答える 0