I am very new to JSON and i really need help. So I have been given this $oldAuctions object and after using PHP's json_decode function (json_decode($oldAuctions, TRUE);) it returned me something like this that has 11 objects with 9 set of name/value pairs in each...
{
"recent_results": [
{
"closing_yield": "0.800",
"auction_id": "106",
"use_buy_it": "0",
"issuer": "National Bank",
"term": "1 Year",
"is_charity": "1",
"end_date": "12-26-2012",
"closing_price": "100.000000",
"issue_type": "FDICs"
},
{
"closing_yield": "1.090",
"auction_id": "339",
"use_buy_it": "0",
"issuer": "National Bank",
"term": "1 Year",
"is_charity": "1",
"end_date": "12-12-2012",
"closing_price": "100.000000",
"issue_type": "FDICs"
},
{
"closing_yield": "2.000",
"auction_id": "041",
"use_buy_it": "0",
"issuer": "National Bank",
"term": "5 Year",
"is_charity": "1",
"end_date": "09-11-2012",
"closing_price": "100.000000",
"issue_type": "FDICs"
}
]
}
Now I need to grab each pair and save their values in an array. For example, I want to grab the auction_id and save it's values in an array.....how can I do that?
Also, just for simple testing purpose I tried to print out the values first...but that didn't work either...
foreach($oldAuctions as $IDs)
{
echo 'Ids: '.$IDs->auction_id;
}
I would really appreciate your help. Thank you!
json_decode()returned.$oldAuctionscontain? JSON string or Array?json_encode