1
내가 이런 JSON 파일 가지고와다차원 배열 json_decode (제 1 레벨)
{
"numeric1": {
"id": "numeric1",
"name": "alphanumeric1",
"key": "alphanumeric2",
"expire": "alphanumeric3",
"status": true,
"ads": true
},
etc...
}
을 (등) I는 행렬 회 이상 반복되는 것을 의미한다.
같이 배열 그리고$allowed = json_decode(file_get_contents("allowed.json"), true);
내가 얻을 : 나는
[0] => Array대신
["numeric1"] => Array의
어떻게 내가 연관 키의 첫 번째 수준을 잃게 그래서
Array
(
[0] => Array
(
[id] => numeric1
[name] => alphanumeric1
[key] => alphanumeric2
[expire] => alphanumeric3
[status] => 1
[ads] => 1
)
etc....
)
이 내가 사용하는 PHP로 구문 분석 내 JSON 배열의 첫 번째 수준을 유지할 수 있습니까? 감사.
JSON 예제에 두 번째 요소를 표시 할 수 있습니까? 그 요소는'numeric2'의 속성 값을 가질까요? –
예 "numeric2", 다음 "numeric3"등 – PurpleFoxy