如何解码以下json字符串?

时间:2016-02-24 17:43:51

标签: php json decode

{"insurer_calls":{"63":{"process":{"eligibility":0,"total":0,"discount":0,"originalvalue":0,"bankcharge":0,"applyinsurer":0,"deliverycharge":null},"loadBenefitsControlsQuote":[{"id":"1108","name":"benefitPABD","producttype":"car","insurerid":"63","options":"","defaultvalues":"","controltype":"1","htmlfieldvalue":"","priority":"1078","display":"0","readonly":"0"},{"id":"1109","name":"benefitPABP","producttype":"car","insurerid":"63","options":"","defaultvalues":"","controltype":"1","htmlfieldvalue":"","priority":"1079","display":"0","readonly":"0"},{"id":"1110","name":"benefitRoadside","producttype":"car","insurerid":"63","options":"","defaultvalues":"","controltype":"1","htmlfieldvalue":"","priority":"1080","display":"0","readonly":"0","curvalue":"##1"},{"id":"1111","name":"benefitRentcar","producttype":"car","insurerid":"63","options":"","defaultvalues":"","controltype":"1","htmlfieldvalue":"","priority":"1081","display":"0","readonly":"0","curvalue":"##1"},{"id":"1112","name":"benefitFST","producttype":"car","insurerid":"63","options":"","defaultvalues":"","controltype":"1","htmlfieldvalue":"","priority":"1082","display":"0","readonly":"0","curvalue":"##1"},{"id":"1113","name":"benefitWindscreen","producttype":"car","insurerid":"63","options":"","defaultvalues":"","controltype":"1","htmlfieldvalue":"","priority":"1083","display":"0","readonly":"0","curvalue":"##1"},{"id":"1114","name":"benefitTerritory","producttype":"car","insurerid":"63","options":"1:UAE\r\n2:UAE and Oman","defaultvalues":"","controltype":"2","htmlfieldvalue":"1:UAE\r\n2:UAE and Oman","priority":"1084","display":"1","readonly":"1"},{"id":"1115","name":"CarExcess","producttype":"car","insurerid":"63","options":"","defaultvalues":"","controltype":"5","htmlfieldvalue":"","priority":"1085","display":"0","readonly":"0","curvalue":"250"},{"id":"1117","name":"benefitTPPD","producttype":"car","insurerid":"63","options":"","defaultvalues":"","controltype":"3","htmlfieldvalue":"2.5 Million AED","priority":"1087","display":"1","readonly":"1"},{"controltype":"info","price":"0","locked":"0","approved":"0"}]},"16":{"process":{"eligibility":-1,"total":1,"discount":0,"originalvalue":1,"bankcharge":1,"applyinsurer":0,"deliverycharge":null},"loadBenefitsControlsQuote":[{"id":"1078","name":"benefitPABD","producttype":"car","insurerid":"16","options":"","defaultvalues":"","controltype":"1","htmlfieldvalue":"","priority":"1048","display":"0","readonly":"0"},{"id":"1079","name":"benefitPABP","producttype":"car","insurerid":"16","options":"","defaultvalues":"","controltype":"1","htmlfieldvalue":"","priority":"1049","display":"0","readonly":"0"},{"id":"1080","name":"benefitRoadside","producttype":"car","insurerid":"16","options":"","defaultvalues":"","controltype":"1","htmlfieldvalue":"50 AED","priority":"1050","display":"1","readonly":"0"},{"id":"1081","name":"benefitRentcar","producttype":"car","insurerid":"16","options":"","defaultvalues":"","controltype":"1","htmlfieldvalue":"","priority":"1051","display":"0","readonly":"0"},{"id":"1082","name":"benefitFST","producttype":"car","insurerid":"16","options":"","defaultvalues":"","controltype":"1","htmlfieldvalue":"","priority":"1052","display":"0","readonly":"0"},{"id":"1083","name":"benefitWindscreen","producttype":"car","insurerid":"16","options":"","defaultvalues":"to be clarified","controltype":"1","htmlfieldvalue":"","priority":"1053","display":"1","readonly":"0"},{"id":"1084","name":"benefitTerritory","producttype":"car","insurerid":"16","options":"1:UAE\r\n2:UAE and Oman\r\n3:GCC","defaultvalues":"","controltype":"2","htmlfieldvalue":"UAE","priority":"1054","display":"1","readonly":"1","curvalue":"1"},{"id":"1085","name":"CarExcess","producttype":"car","insurerid":"16","options":"","defaultvalues":"","controltype":"5","htmlfieldvalue":"200-750 AED depending on car value","priority":"1055","display":"1","readonly":"1","curvalue":"200-750 AED depending on car value"},{"id":"1087","name":"benefitTPPD","producttype":"car","insurerid":"16","options":"","defaultvalues":"","controltype":"5","htmlfieldvalue":"","priority":"1057","display":"1","readonly":"1","curvalue":"500,000 AED"},{"controltype":"info","price":"1","locked":"0","approved":"0"}]},"172":{"process":{"eligibility":0,"total":0,"discount":0,"originalvalue":0,"bankcharge":0,"applyinsurer":0,"deliverycharge":null},"loadBenefitsControlsQuote":[{"id":"3931","name":"benefitPABD","producttype":"car","insurerid":"172","options":"1:UAE\r\n2:UAE and Oman","defaultvalues":"","controltype":"1","htmlfieldvalue":"","priority":"2176","display":"0","readonly":"0"},{"id":"3932","name":"benefitPABP","producttype":"car","insurerid":"172","options":"","defaultvalues":"","controltype":"1","htmlfieldvalue":"","priority":"2177","display":"0","readonly":"0"},{"id":"3933","name":"benefitRoadside","producttype":"car","insurerid":"172","options":"","defaultvalues":"","controltype":"1","htmlfieldvalue":"","priority":"2178","display":"0","readonly":"0","curvalue":"##1"},{"id":"3934","name":"benefitRentcar","producttype":"car","insurerid":"172","options":"","defaultvalues":"","controltype":"3","htmlfieldvalue":"Automatic Cover if Base Premium is AED 4K and above","priority":"2179","display":"1","readonly":"1"},{"id":"3935","name":"benefitFST","producttype":"car","insurerid":"172","options":"","defaultvalues":"","controltype":"1","htmlfieldvalue":"","priority":"2180","display":"0","readonly":"0","curvalue":"##1"},{"id":"3936","name":"benefitWindscreen","producttype":"car","insurerid":"172","options":"","defaultvalues":"","controltype":"3","htmlfieldvalue":"Waived Once","priority":"2181","display":"1","readonly":"1","curvalue":"##1"},{"id":"3937","name":"benefitTerritory","producttype":"car","insurerid":"172","options":"1:UAE\r\n2:UAE and Oman","defaultvalues":"","controltype":"2","htmlfieldvalue":"","priority":"2182","display":"1","readonly":"1"},{"id":"3938","name":"CarExcess","producttype":"car","insurerid":"172","options":"","defaultvalues":"","controltype":"5","htmlfieldvalue":"","priority":"2183","display":"0","readonly":"0","curvalue":"250"},{"id":"3939","name":"benefitTPPD","producttype":"car","insurerid":"172","options":"","defaultvalues":"","controltype":"3","htmlfieldvalue":"Aed 2.5 Million","priority":"2184","display":"1","readonly":"1"},{"controltype":"info","price":"0","locked":"0","approved":"0"}]},"2":{"process":{"eligibility":0,"total":5823,"discount":0,"originalvalue":5823,"bankcharge":143,"applyinsurer":0,"deliverycharge":null},"loadBenefitsControlsQuote":[{"id":"39","name":"benefitPABD","producttype":"car","insurerid":"2","options":"","defaultvalues":"","controltype":"1","htmlfieldvalue":"","priority":"11","display":"0","readonly":"0"},{"id":"40","name":"benefitPABP","producttype":"car","insurerid":"2","options":"","defaultvalues":"","controltype":"1","htmlfieldvalue":"","priority":"12","display":"0","readonly":"0"},{"id":"41","name":"benefitRoadside","producttype":"car","insurerid":"2","options":"","defaultvalues":"","controltype":"1","htmlfieldvalue":"","priority":"13","display":"1","readonly":"0","curvalue":"##1"},{"id":"42","name":"benefitRentcar","producttype":"car","insurerid":"2","options":"","defaultvalues":"","controltype":"1","htmlfieldvalue":"","priority":"14","display":"0","readonly":"0"},{"id":"43","name":"benefitFST","producttype":"car","insurerid":"2","options":"","defaultvalues":"","controltype":"1","htmlfieldvalue":"","priority":"15","display":"0","readonly":"0","curvalue":"##1"},{"id":"44","name":"benefitWindscreen","producttype":"car","insurerid":"2","options":"","defaultvalues":"","controltype":"1","htmlfieldvalue":"","priority":"16","display":"1","readonly":"0","curvalue":"##0"},{"id":"45","name":"","producttype":"car","insurerid":"2","options":"","defaultvalues":"","controltype":"3","htmlfieldvalue":"UAE and Oman if comprehensive, UAE only if TPL","priority":"17","display":"1","readonly":"0"},{"id":"46","name":"CarExcess","producttype":"car","insurerid":"2","options":"","defaultvalues":"","controltype":"5","htmlfieldvalue":"","priority":"18","display":"1","readonly":"0","curvalue":"500"},{"id":"48","name":"","producttype":"car","insurerid":"2","options":"","defaultvalues":"","controltype":"3","htmlfieldvalue":"1.5 Million AED","priority":"20","display":"1","readonly":"0"},{"controltype":"info","price":"5823","locked":"0","approved":"0"}]},"173":{"process":{"eligibility":0,"total":50,"discount":0,"originalvalue":50,"bankcharge":0,"applyinsurer":0,"deliverycharge":null},"loadBenefitsControlsQuote":[{"id":"3940","name":"benefitPABD","producttype":"car","insurerid":"173","options":"","defaultvalues":"","controltype":"1","htmlfieldvalue":"","priority":"2185","display":"1","readonly":"0"},{"id":"3941","name":"benefitPABP","producttype":"car","insurerid":"173","options":"","defaultvalues":"","controltype":"1","htmlfieldvalue":"","priority":"2186","display":"1","readonly":"0"},{"id":"3942","name":"benefitRoadside","producttype":"car","insurerid":"173","options":"","defaultvalues":"","controltype":"1","htmlfieldvalue":"","priority":"2187","display":"1","readonly":"0"},{"id":"3943","name":"benefitRentcar","producttype":"car","insurerid":"173","options":"","defaultvalues":"","controltype":"1","htmlfieldvalue":"","priority":"2188","display":"1","readonly":"0"},{"id":"3944","name":"benefitFST","producttype":"car","insurerid":"173","options":"","defaultvalues":"","controltype":"1","htmlfieldvalue":"","priority":"2189","display":"0","readonly":"0"},{"id":"3945","name":"benefitWindscreen","producttype":"car","insurerid":"173","options":"","defaultvalues":"","controltype":"3","htmlfieldvalue":"Waived Once","priority":"2190","display":"1","readonly":"0"},{"id":"3946","name":"benefitTerritory","producttype":"car","insurerid":"173","options":"1:UAE and Oman\r\n","defaultvalues":"","controltype":"2","htmlfieldvalue":"","priority":"2191","display":"1","readonly":"1"},{"id":"3947","name":"CarExcess","producttype":"car","insurerid":"173","options":"","defaultvalues":"","controltype":"5","htmlfieldvalue":"","priority":"2192","display":"0","readonly":"0","curvalue":"250"},{"id":"3948","name":"benefitTPPD","producttype":"car","insurerid":"173","options":"","defaultvalues":"","controltype":"3","htmlfieldvalue":"Up to AED 2,000,000","priority":"2193","display":"1","readonly":"1"},{"controltype":"info","price":"50","locked":"0","approved":"0"}]},"128":{"process":{"eligibility":0,"total":0,"originalvalue":0,"applyinsurer":0,"deliverycharge":null},"loadBenefitsControlsQuote":[{"id":"2399","name":"benefitPABD","producttype":"car","insurerid":"128","options":"","defaultvalues":"","controltype":"1","htmlfieldvalue":"","priority":"1493","display":"0","readonly":"0"},{"id":"2400","name":"benefitPABP","producttype":"car","insurerid":"128","options":"","defaultvalues":"","controltype":"1","htmlfieldvalue":"","priority":"1494","display":"0","readonly":"0"},{"id":"2401","name":"benefitRoadside","producttype":"car","insurerid":"128","options":"","defaultvalues":"","controltype":"1","htmlfieldvalue":"","priority":"1495","display":"0","readonly":"0","curvalue":"##1"},{"id":"2402","name":"benefitRentcar","producttype":"car","insurerid":"128","options":"","defaultvalues":"","controltype":"1","htmlfieldvalue":"","priority":"1496","display":"0","readonly":"0"},{"id":"2403","name":"benefitFST","producttype":"car","insurerid":"128","options":"","defaultvalues":"","controltype":"1","htmlfieldvalue":"","priority":"1497","display":"0","readonly":"0","curvalue":"##1"},{"id":"2404","name":"benefitWindscreen","producttype":"car","insurerid":"128","options":"","defaultvalues":"","controltype":"1","htmlfieldvalue":"","priority":"1498","display":"0","readonly":"0","curvalue":"##1"},{"id":"2405","name":"benefitOman","producttype":"car","insurerid":"128","options":"0:UAE Only\r\n1:UAE and Oman","defaultvalues":"","controltype":"2","htmlfieldvalue":"UAE and Oman","priority":"1499","display":"0","readonly":"0","curvalue":"##0"},{"id":"2406","name":"CarExcess","producttype":"car","insurerid":"128","options":"","defaultvalues":"","controltype":"5","htmlfieldvalue":"","priority":"1500","display":"0","readonly":"0","curvalue":"200"},{"id":"2407","name":"benefitTPPD","producttype":"car","insurerid":"128","options":"","defaultvalues":"","controltype":"5","htmlfieldvalue":"1 Million AED","priority":"1501","display":"0","readonly":"0"},{"controltype":"info","price":"0","locked":"0","approved":"0"}]},"61":{"process":{"eligibility":-1,"total":0,"originalvalue":0,"applyinsurer":0,"deliverycharge":null},"loadBenefitsControlsQuote":[{"id":"1098","name":"benefitPABD","producttype":"car","insurerid":"61","options":"","defaultvalues":"","controltype":"1","htmlfieldvalue":"","priority":"1068","display":"0","readonly":"0"},{"id":"1099","name":"benefitPABP","producttype":"car","insurerid":"61","options":"","defaultvalues":"","controltype":"1","htmlfieldvalue":"","priority":"1069","display":"0","readonly":"0"},{"id":"1100","name":"benefitRoadside","producttype":"car","insurerid":"61","options":"","defaultvalues":"","controltype":"3","htmlfieldvalue":"Covered","priority":"1070","display":"1","readonly":"0"},{"id":"1101","name":"benefitRentcar","producttype":"car","insurerid":"61","options":"","defaultvalues":"","controltype":"1","htmlfieldvalue":"","priority":"1071","display":"0","readonly":"0"},{"id":"1102","name":"benefitFST","producttype":"car","insurerid":"61","options":"","defaultvalues":"","controltype":"1","htmlfieldvalue":"","priority":"1072","display":"0","readonly":"0"},{"id":"1103","name":"benefitWindscreen","producttype":"car","insurerid":"61","options":"","defaultvalues":"","controltype":"3","htmlfieldvalue":"Covered","priority":"1073","display":"1","readonly":"0"},{"id":"1104","name":"benefitTerritory","producttype":"car","insurerid":"61","options":"1:UAE\r\n2:UAE and Oman\r\n3:GCC\r\n4:UAE, UAE and Oman, GCC depending on the plan","defaultvalues":"","controltype":"2","htmlfieldvalue":"UAE","priority":"1074","display":"1","readonly":"1","curvalue":"1"},{"id":"1105","name":"CarExcess","producttype":"car","insurerid":"61","options":"","defaultvalues":"200-3500 AED depending on car value","controltype":"5","htmlfieldvalue":"200-3500 AED depending on car value","priority":"1075","display":"1","readonly":"1","curvalue":"200-3500 AED depending on car value"},{"id":"1107","name":"benefitTPPD","producttype":"car","insurerid":"61","options":"","defaultvalues":"2.5Million","controltype":"5","htmlfieldvalue":"2.5Million","priority":"1077","display":"0","readonly":"1","curvalue":"2.5 Million"},{"controltype":"info","price":"0","locked":"0","approved":"0"}]},"62":{"process":{"eligibility":-1,"total":0,"originalvalue":0,"applyinsurer":0,"deliverycharge":null},"loadBenefitsControlsQuote":[{"id":"1088","name":"benefitPABD","producttype":"car","insurerid":"62","options":"","defaultvalues":"","controltype":"1","htmlfieldvalue":"","priority":"1058","display":"0","readonly":"0"},{"id":"1089","name":"benefitPABP","producttype":"car","insurerid":"62","options":"","defaultvalues":"","controltype":"1","htmlfieldvalue":"","priority":"1059","display":"0","readonly":"0"},{"id":"1090","name":"benefitRoadside","producttype":"car","insurerid":"62","options":"","defaultvalues":"","controltype":"1","htmlfieldvalue":"Covered","priority":"1060","display":"0","readonly":"0","curvalue":"##1"},{"id":"1091","name":"benefitRentcar","producttype":"car","insurerid":"62","options":"","defaultvalues":"","controltype":"1","htmlfieldvalue":"","priority":"1061","display":"0","readonly":"0"},{"id":"1092","name":"benefitFST","producttype":"car","insurerid":"62","options":"","defaultvalues":"","controltype":"1","htmlfieldvalue":"","priority":"1062","display":"0","readonly":"0"},{"id":"1093","name":"benefitWindscreen","producttype":"car","insurerid":"62","options":"","defaultvalues":"","controltype":"3","htmlfieldvalue":"Covered","priority":"1063","display":"1","readonly":"0"},{"id":"1094","name":"benefitTerritory","producttype":"car","insurerid":"62","options":"1:UAE\r\n2:UAE and Oman\r\n3:GCC\r\n4:UAE, UAE and Oman, GCC depending on the plan","defaultvalues":"","controltype":"2","htmlfieldvalue":"Can cover UAE Only, UAE and Oman or GCC depending on the plan","priority":"1064","display":"0","readonly":"1","curvalue":"4"},{"id":"1095","name":"CarExcess","producttype":"car","insurerid":"62","options":"","defaultvalues":"","controltype":"5","htmlfieldvalue":"200-10,000 AED","priority":"1065","display":"1","readonly":"0","curvalue":"200-10,000 AED"},{"id":"1097","name":"benefitTPPD","producttype":"car","insurerid":"62","options":"","defaultvalues":"3.5 Million or 5 Million depending on the plan","controltype":"5","htmlfieldvalue":"3.5 Million or 5 Million depending on the plan","priority":"1067","display":"0","readonly":"1","curvalue":"3.5 Million or 5 Million depending on the plan"},{"controltype":"info","price":"0","locked":"0","approved":"0"}]},"4":{"process":{"eligibility":0,"total":0,"originalvalue":0,"applyinsurer":0,"deliverycharge":null},"loadBenefitsControlsQuote":[{"id":"59","name":"benefitPABD","producttype":"car","insurerid":"4","options":"","defaultvalues":"","controltype":"1","htmlfieldvalue":"","priority":"31","display":"0","readonly":"0"},{"id":"60","name":"benefitPABP","producttype":"car","insurerid":"4","options":"","defaultvalues":"","controltype":"1","htmlfieldvalue":"","priority":"32","display":"0","readonly":"0"},{"id":"61","name":"benefitRoadside","producttype":"car","insurerid":"4","options":"","defaultvalues":"","controltype":"1","htmlfieldvalue":"","priority":"33","display":"1","readonly":"0","curvalue":"##1"},{"id":"62","name":"benefitRentcar","producttype":"car","insurerid":"4","options":"","defaultvalues":"","controltype":"1","htmlfieldvalue":"","priority":"34","display":"0","readonly":"0"},{"id":"63","name":"benefitFST","producttype":"car","insurerid":"4","options":"","defaultvalues":"","controltype":"1","htmlfieldvalue":"","priority":"35","display":"0","readonly":"0","curvalue":"##0"},{"id":"64","name":"benefitWindscreen","producttype":"car","insurerid":"4","options":"","defaultvalues":"","controltype":"1","htmlfieldvalue":"","priority":"36","display":"1","readonly":"0"},{"id":"65","name":"","producttype":"car","insurerid":"4","options":"","defaultvalues":"","controltype":"3","htmlfieldvalue":"UAE","priority":"37","display":"1","readonly":"0"},{"id":"66","name":"CarExcess","producttype":"car","insurerid":"4","options":"","defaultvalues":"","controltype":"5","htmlfieldvalue":"","priority":"38","display":"1","readonly":"0","curvalue":"200"},{"id":"68","name":"","producttype":"car","insurerid":"4","options":"","defaultvalues":"","controltype":"3","htmlfieldvalue":"AED 500,000","priority":"40","display":"1","readonly":"0"},{"controltype":"info","price":"0","locked":"0","approved":"0"}]}},"getProductInsurers":[{"id":"63","name":"Renown AAA-Insurance Company","alias":"Renown AAA-Insurance Company","insurercode":"TMSP","rating":"Credit Rating A++ (Superior)* ","image":null,"locked":0,"applied":0,"status":0},{"id":"172","name":"Renown AAA-Insurance Company-4x4","alias":"Renown AAA-Insurance Company-4x4","insurercode":"METM","rating":"","image":null,"locked":0,"applied":0,"status":0},{"id":"2","name":"Noor Takaful","alias":"Noor Takaful","insurercode":"NT","rating":"","image":"\/includes\/insurerman\/logos\/insurer_2.jpg","locked":0,"applied":0,"status":0},{"id":"173","name":"Renown AAA-Insurance Company-Must","alias":"Renown AAA-Insurance Company-Must","insurercode":"METM","rating":"","image":null,"locked":0,"applied":0,"status":0},{"id":"128","name":"Watania","alias":"Watania","insurercode":"WTN","rating":"","image":null,"locked":0,"applied":0,"status":0},{"id":"4","name":"AMAN","alias":"AMAN","insurercode":"AMAN","rating":"","image":"\/includes\/insurerman\/logos\/insurer_4.jpg","locked":0,"applied":0,"status":0},{"id":"16","name":"Oman","alias":"Oman","insurercode":"OMAN","rating":"","image":"\/includes\/insurerman\/logos\/insurer_16.jpg","locked":0,"applied":0,"status":0},{"id":"61","name":"AXA","alias":"AXA","insurercode":"AXA","rating":"","image":"\/includes\/insurerman\/logos\/insurer_61.jpg","locked":0,"applied":0,"status":0},{"id":"62","name":"Zurich","alias":"Zurich","insurercode":"ZRC","rating":"","image":"\/includes\/insurerman\/logos\/insurer_62.jpg","locked":0,"applied":0,"status":0}],"loadBenefitsLabels":[{"id":"22","label":"Personal Accident Benefit to Driver ","producttype":"car","priority":"1","name":"benefit_benefitPABD","display":"0","filtername":"benefitPABD"},{"id":"23","label":"Personal Accident Benefit to Passenger","producttype":"car","priority":"2","name":"benefit_benefitPABP","display":"0","filtername":"benefitPABP"},{"id":"24","label":"RoadSide Assistance Cover","producttype":"car","priority":"3","name":"","display":"1","filtername":""},{"id":"25","label":"Rent A Car Benefit","producttype":"car","priority":"4","name":"","display":"0","filtername":"benefitRentcar"},{"id":"26","label":"FST (Fire, Storm, Tempest) Cover","producttype":"car","priority":"5","name":"","display":"0","filtername":"benefitFST"},{"id":"27","label":"Windscreen claims","producttype":"car","priority":"6","name":"","display":"1","filtername":""},{"id":"28","label":"Territory Cover","producttype":"car","priority":"7","name":"","display":"1","filtername":""},{"id":"29","label":"Excess","producttype":"car","priority":"8","name":"","display":"1","filtername":""},{"id":"31","label":"Third Party Property Damage","producttype":"car","priority":"10","name":"","display":"1","filtername":""}]}

需要解码上面的json字符串。当我解码它显示错误。

1 个答案:

答案 0 :(得分:0)

我可以使用php json_decode解码你的 JSON 而不会出现问题:

$json = 'YOUR_JSON';
var_dump(json_decode($json));
var_dump(json_decode($json, true));

如果你需要调用一个对象:

$json = file_get_contents('your_json_url'); #I suggest you upload your json and get it by URL
$obj = json_decode($json);
echo $obj->element; #element is the json object that you need to call

使用此Online JSON Formatter & Validater Tool

在线查看您的json