javascript - decode json with number object in php -
i working http api sending sms. trying decode json file receive after made post url. want know how can decode thing.. if static can decode fact have number key may increase extension. in case , how decode post , need save in mysql. please me out of problem.
{"msg_id":"4396-7666-1337896-1dc5c765ad7-5537bb07-123638242","senderid":"execut","linecount":"1","billcredit":"0.00","message":"hello+test+message","sendondate":"2015-04-22 20:45:00","seq_id":{"**1**":{"valid":"true","billcredit":"1.00","id_provider":"24","providerkey":"hutch","regionkey":"wb","originalnumber":"1234567890","validnumber":"1234567890","mnpid":"106","dlr_seq":1},"**2**":{"valid":"true","billcredit":"1.00","id_provider":"24","providerkey":"hutch","regionkey":"wb","originalnumber":"1234567890","validnumber":"1234567890","mnpid":"106","dlr_seq":2}}}
i did following
$json = file_get_contents($daat); $obj = json_decode($json); $num= $obj->seq_id->{'1'}->validnumber;
but valid if having static json incase of dynamic one.
i think you're looking json_decode() function. http://php.net/manual/en/function.json-decode.php
i'm not sure how address concerns number size without more information expected inputs.
Comments
Post a Comment