회사의 API를 사용하여 뭔가를 시험해보고 싶었습니다. 데이터를 데이터베이스에 저장하려고했습니다. 하지만 문제가 생겼어. API에는 "venue.country"라는 하나의 JSON 객체가 있습니다. 하지만 어떤 이유로 배열에서 도트를 사용할 수 없습니까? 여기 배열에서 도트를 사용할 수없는 이유는 무엇입니까?
코드입니다 : PHP를 에서foreach ($data[1]['hits']['hits'] as $row) {
$statement->execute(array(
"name" => $row['fields']['name'][0],
"date" => $row['fields']['start'][0],
"lang_long" => "test",
It is this one! -> "country" => $row['fields']['venue.country'][0],
"genres" => $row['fields']['genres'][0],
"desc" => $row['fields']['description'][0],
"logo" => $row['fields']['logo'][0],
"header_pic" => $row['fields']['header'][0]
));
}
\ 모든 다른 작품 그리고 여기에 JSON의 조각입니다 :
venue.country: [
"Nederland"
],
가 어떻게이 작업을 얻을 수 있나요? "폭발"방법을 사용할 수 있습니까? https://hugo.events/genre/pop/next/200/120
감사 :
이 전체 JSON이다.
편집 : 응답 @Prototype 체인은 나에게이 오류주고있다 준도 함께 :이 트릭을 할 것입니다 Notice: Undefined index: venue in /home/ubuntu/workspace/pop.php on line 18
정말 PHP 오류입니까? 어떤 오류가 발생하고 있습니까? – ordonezalex
'print_r ($ row);'의 결과는 무엇입니까? – Rizier123