ユーザーの会場のデータ(ユーザーのチェックイン情報から会場の詳細)を取得しようとしています。データを取得するためにユーザーアクセストークンを使用しています。これは私が使用しているコードです:
if($_GET['code']){
$authkey = file_get_contents("https://foursquare.com/oauth2/access_token? client_id=".$client_id."&client_secret=".$secret."&grant_type=authorization_code&redirect_uri=".$redirect."&code=".$_GET['code']);
$decoded_auth = json_decode($authkey,true);
$venueinfo = file_get_contents("https://api.foursquare.com/v2/users/self/checkins?oauth_token=$access_token&v=$version");
$decoded_venueinfo = json_decode($venueinfo, true);
foreach ($decoded_venueinfo->response->checkins->items->venue as $result){
echo $result->name;
echo $result->id;
echo $result->location->address;
echo $result->location->city;
echo $result->location->country;
}
}
空白のページが表示されます。最初の「if」の最後に「else」をエコー「error」で追加しようとしましたが、表示されたので、「if」ステートメントの条件はfalseだと思います。私はPHPにかなり慣れていないので、学習しながら学びます。どんな助けでも深く感謝されます。