データを取得できませんでした…。

' ; } else { // HTML $html .= '

実行結果

' ; $html .= '

下記の内容で取得しました。

' ; // ループ foreach( $obj as $item ) { // 1日ごとの滞在記録を解析 $html .= '

' . $item->date . '

' ; // 内容がなければスキップ if( !isset( $item->segments ) || empty( $item->segments ) ) { continue ; } // セグメントごとの処理 foreach( $item->segments as $segment ) { // 各データ $start = date( 'H:i', strtotime( $segment->startTime ) ) ; // 開始時間 $end = date( 'H:i' , strtotime( $segment->endTime ) ) ; // 終了時間 $name = ( isset($segment->place->name) && !empty($segment->place->name) ) ? $segment->place->name : '不明' ; // 場所名 $type = $segment->place->type ; // 場所タイプ $lat = $segment->place->location->lat ; // 緯度 $lon = $segment->place->location->lon ; // 経度 // 出力 $html .= '

' . $start . '〜' . $end . '

' ; $html .= '
' ; $html .= '
名前
' ; $html .= '
' . $name . '
' ; $html .= '
場所タイプ
' ; $html .= '
' . $type . '
' ; $html .= '
緯度
' ; $html .= '
' . $lat . '
' ; $html .= '
経度
' ; $html .= '
' . $lon . '
' ; $html .= '
' ; } } } // 取得したデータ $html .= '

取得したデータ

' ; $html .= '

下記のデータを取得できました。

' ; $html .= '

JSON

' ; $html .= '

' ; $html .= '

レスポンスヘッダー

' ; $html .= '

' ; ?> Moves APIで指定期間の滞在記録(プレイス)を取得するサンプルデモ

配布元: Syncer