$str = file_get_contents('http://uapi.alidays.it/service/2.0.0/rs/alidays/applications/fluidtravel/public/baskets/5660609ee4b0ab55863d6c42/contents/selected');
$json =json_decode($str,true);
echo '<pre>' . print_r($json,true) . '</pre>';
foreach($json['data'] as $item['value']['baskettile']) {
echo $item['value']['baskettile']['type'];
echo '<br>';
}
我試圖訪問這樣的數據,但它說警告:()提供的foreach無效參數讀取JSON數據
'PHP警告:非法字符串偏移'類型'在 - 線6' – Quentin
是的我知道我當我試過我知道了它你知道我爲什麼得到那@Quentin –
你明白了嗎?那你爲什麼不在你的問題中提到這個? – Quentin