I have been reading ans studying your article on Json and it is really good but I can't seem to parse and display the individual elements of the following. I am pasting the json and the code I'm trying to use. I modified it from your example but of course I'm doing something wrong.
I would rather not use the 'true' to create the array but would like to know how to parse this json both ways.
Thank You for your help,
Ken
$jsonString = '
{
"Report":{"@attributes":{
"Name":"rpt_Exception"
},
"table1":{
"@attributes":{
"textbox1":"Car dealership",
"textbox15":"R&R Data: 3\/31\/2011 8:17:42 AM"
},
"grp_Account_Collection":
{
"grp_Account":[
{
"textbox17":"TOTAL for Acct 205 => 10 Days",
"textbox21":"819,593"
},
"Grp_Carline_Collection":{"Grp_Carline":
{
"Detail_Collection":
{
"Detail":[
{"@attributes":
{
"Account":"205",
"Description":"Contracts In Transit",
"ControlNumber":"8888",
"AgeInDays":"95",
"Balance":"2,003.32",
"CustomerNo":"99999",
"CustomerName":"Davis",
"BankNameOrCarLine":"Auto Finance"
}
},
{"@attributes":
{
"Account":"205",
"Description":"Contracts In Transit",
"ControlNumber":"7777",
"AgeInDays":"82",
"Balance":"(1,123.34)",
"CustomerNo":"66666",
"CustomerName":"Holmes",
"BankNameOrCarLine":"C A C"
}
},
],
}
}
],
}
}
}
}
';
$cart = json_decode( $jsonString,true );
print_r($cart);