0
我打電話Google Places Photo API
像這樣在我的Laravel的PHP應用程序:如何使用Google Places Photo API返回的照片?
public static function getpic ($photoreference){
$app_id = 'XXXYYYZZZ';
$URLToCall = "https://maps.googleapis.com/maps/api/place/photo?maxwidth=225&photoreference=$photoreference&sensor=false&key=$app_id";
$result = file_get_contents($URLToCall);
return $result;
}
當我print_r $result
,我得到:
string(12902) "ÿØÿàJFIFÿá`ExifII*1&i‡.Picasa0220 á –ÿÛ„
我無法弄清楚如何使用所返回的。我試圖將字符串傳遞給視圖,但失敗了。
有什麼建議嗎?