이것은 멍청한 질문입니다. 나는 다음과 같은 모습의 JSON 파일로 작업하고있다.PHP로 JSON 데이터 구문 분석하기
{"nodes":
[{"node":
{"Vocabulary name":"Bestseller Format",
"Term":"Hardcover Fiction",
"Bestseller1":"9780470227800",
"Bestseller2":"9781451617962",
"Bestseller3":"9781439167397",
"Bestseller4":"9781617750106",
"Bestseller5":"9780385533300",
"Bestseller6":"9780670022526",
"Bestseller7":"9781609530358",
"Bestseller8":"9780132358040",
"Bestseller9":"9780596159771",
"Bestseller10":"9780151014163",
"Bestseller11":"9780393334807",
"Bestseller12":"9780805090161"}
}]
}
그리고 나는 PHP로 파싱을 시도하고있다. 베스트 셀러 형식 - 나는
<?php
$jsonurl = "http://www.xtracrunchy.com/pandpnewlook/?q=pandp/bestsellers";
$json = file_get_contents($jsonurl,NULL, NULL, 0, 1000);
$json_output = json_decode($json,true);
$bestseller_array = $json_output[nodes][0][node];
foreach ($bestseller_array as $key => $value)
{
print $key;
print " - ";
print $value;
print "<br />";
}
?>
가 나는이 스크립트가
어휘 이름을 실행할 때 결국 베스트 셀러 ISBN의의 정렬 된 목록하지만 내가 할 수있는 유일한 출력을 구축 할 수 있도록하고 싶습니다 스크립트와 함께 올라와있다 용어 - 양장본
그리고 인쇄 매수 ($ bestseller_array)를 추가 할 때; 배열에 2 요소 만 가져옵니다.
도움을 주시면 감사하겠습니다.
'code' 태그로 코드를 넣을 수 있습니까? 그리고 모든 것을 읽을 수있게 ... 고마워요 : D – fingerman
직접 포맷팅을 고쳤습니다. 다음 번에는 각 코드 줄 앞에 4 칸을 추가하십시오. – Christian
덕분에 @christian – fingerman