【发布时间】:2016-10-19 06:36:49
【问题描述】:
我无法遍历这个 JSON,因为它有不同的名称。如何循环并获取“general_release”或“special_immigrant_juvenile_fundings”中的数据?我是 json 的新手,我认为这种事情对我来说处理起来相当高。
这是json,请忽略空值:
{
"referral": {
"PD_Subject": "Urgent Please Respond",
"PD_Location": "1",
"referral_start_date": "10/19/2016 9:12 AM",
"referral_end_date": "10/31/2016 9:12 AM",
"publicdefender": "Rommel",
"email_pd": "Rommel@yahoo.com",
"number_pd": "123456",
"socialworker": "Rommel",
"email_sw": "rommel@yahoo.com",
"number_sw": "12345567",
"PB_firstname": "Rommel",
"PB_lastname": "Semira",
"PB_mobile": "12345678",
"alternate_mobile": "1234578",
"other_names": "Rommel",
"PB_email_address": "staypot@rocketmail.com",
"PB_address": "123213123",
"PB_birthdate": "10/05/2016 9:12 AM",
"PB_gender": "Male",
"PB_birthplace": "Australia\r\n",
"language": "English",
"other_language": "Spanish",
"guardian_fullname": "Rommel",
"PB_relationshipToClient": "1234568",
"guardian_address": "qwertyu",
"guardian_number": "123123123",
"guardian_alternatenumber": "123123123",
"juvenile_dateOfArrest": "10/27/2016",
"juvenile_charge": "123123123",
"juvenile_disposition": "qweqweqwe",
"PB_juvenile_courtDate": "10/22/2016",
"court_date_location": "qweqweq",
"PB_history_dateOfArrest": "10/29/2016",
"history_charge": "qweqwe",
"history_county": "Alpine",
"registed_sss": "1",
"history_outcome": "qweqweqwe",
"referral_notes": "qweqweqwe"
},
"general_release": {
"sijs_firm_name": "",
"sijs_street_address": "",
"sijs_city": "",
"sijs_state": "",
"sijs_zipcode": "",
"sijs_telephone_number": "",
"sijs_fax": "",
"sijs_email_address": "",
"sijs_attorney": "",
"sijs_county": "",
"sijs_mailing_address": "",
"sijs_branch_name": "",
"sijs_case_name": "",
"sijs_case_number": "",
"sijs_child_name": "",
"sijs_date_of_birth": "",
"sijs1_datetime_hearing": "",
"sijs_department": "",
"sijs_room": "",
"sijs_judicial_officer": "",
"sijs_attorney_presents": "",
"sijs_child_country": "",
"sijs_child_juvenile_court": "",
"sijs_placed_under_custody_name": "",
"sijs_custody_entity_name": "",
"sijs_state_of_agency_location": "",
"sijs_california_court_date": "",
"general_appointment_id": "276",
"type_of_form": "general_release"
},
"special_immigrant_juvenile_fundings": {
"_token": " ti9qqsqzOMRzEo4PZd1I2wwWFSdyIM3jrXJTAenK",
"sijs_firm_name": "",
"sijs_street_address": "",
"sijs_city": "",
"sijs_state": "",
"sijs_zipcode": "",
"sijs_telephone_number": "",
"sijs_fax": "",
"sijs_email_address": "",
"sijs_attorney": "",
"sijs_county": "",
"sijs_mailing_address": "",
"sijs_branch_name": "",
"sijs_case_name": "",
"sijs_case_number": "",
"sijs_child_name": "",
"sijs_date_of_birth": "",
"sijs1_datetime_hearing": "",
"sijs_department": "",
"sijs_room": "",
"sijs_judicial_officer": "",
"sijs_attorney_presents": "",
"sijs_child_country": "",
"sijs_child_juvenile_court": "",
"sijs_placed_under_custody_name": "",
"sijs_custody_entity_name": "",
"sijs_state_of_agency_location": "",
"sijs_california_court_date": "",
"general_appointment_id": "276",
"type_of_form": "special_immigrant_juvenile_fundings"
}
}
【问题讨论】:
-
json_decode() 比循环