I am receiving the output below from a web service. (Output shown is via var_dump(json_decode($json,true));
To get data from the latter part of the object I can use, for example:
$obj = json_decode($json);
$myvalue=$obj->{'CurrentAccountNumber'};
but I also need to get data from the arrays at the beginning of the object (via php). What is the right syntax to use to get/echo the array data using php? Thank you!
OUTPUT FROM WEB SERVICE:
array(30) { ["Accounts"]=> array(2) { [0]=> array(4) { ["AccountNumber"]=> string(9) "123456789" ["CurrentBalance"]=> float(455.17) ["FullName"]=> string(8) "JOHN DOE" ["CodeNum"]=> string(3) "A34" } [1]=> array(4) { ["AccountNumber"]=> string(9) "123456788" ["CurrentBalance"]=> float(67.22) ["FullName"]=> string(8) "JOHN DOE" ["CodeNum "]=> string(3) "B82" } }
HOW DO I GET DATA FROM THE ARRAYS ABOVE THIS LINE?
["CurrentAccountNumber"]=> string(9) "123456789" ["CurrentBalance"]=> float(455.17) ["CustomMonth"]=> bool(true) ["CustomMonthAmt"]=> float(488.17) ["CustomMonthLength"]=> int(0) ["DateOfService"]=> string(10) "2013-06-15" ["EighteenMonth"]=> bool(false) ["EighteenMonthAmt"]=> int(0) ["ExpectedLastPaymentAmount"]=> float(0) ["ExpectedLastPaymentDate"]=> string(0) "" ["FullName"]=> string(8) "JOHN DOE" ["Email"]=> string(11) "myemail.com" ["LastFourPhone"]=> string(4) "5128" ["LastPaymentAmount"]=> float(4205.83) ["LastPaymentDate"]=> string(10) "2015-04-28" ["NextPaymentAmount"]=> float(0) ["NextPaymentDate"]=> string(0) "" ["Category"]=> int(0) ["InsPlanStartDate"]=> string(10) "2016-10-08" ["PrimaryPhoneNumber"]=> string(10) "5555555128" ["SixMonth"]=> bool(false) ["SixMonthAmt"]=> int(0) ["CodeNum"]=> string(3) "A34" ["TwelveMonth"]=> bool(false) ["TwelveMonthAmt"]=> int(0) ["TwentyFourMonth"]=> bool(false) ["TwentyFourMonthAmt"]=> int(0) ["UseInfoOnFile"]=> bool(true) ["ZipCode"]=> string(5) "12345" }