ตัวอย่างเช่นที่ผมใช้
$url = 'http://graph.facebook.com/shashankvaishnav/picture';
$data = file_get_contents($url);
$fileName = 'fb_profilepic.jpg';
$file = fopen($fileName, 'w+');
fputs($file, $data);
fclose($file);
$ch = curl_init();
curl_setopt ($ch, CURLOPT_URL, 'http://graph.facebook.com/shashankvaishnav/picture');
curl_setopt ($ch, CURLOPT_RETURNTRANSFER, 1);
$data = curl_exec($ch);
curl_close($ch);
$fileName = 'fb_profilepic.jpg';
$file = fopen($fileName, 'w+');
fputs($file, $data);
fclose($file);
พอใช้ฟังก์ชั่นด้านบนแล้วเชฟออกมาไฟลล์มีขนาด 0 bytes เปิดมาไม่มีอะไรเลย
ท่านใดพอจะมีฟังก์ชั่นที่เชฟรูปได้แนะนำใหมครับ