I have a json that I need to filter a specific key and value from
the following json
{
"5": {
"Owner": "94EAC",
"Record":"0121ln"
},
"15": {
"Owner": "009AC",
"Record":"0120Pc"
},
"1": {
"Owner": "00G11A",
"Record":"000lPcn"
},
"199": {
"Owner": "00G1y9",
"Record":"01211cn"
},
"33": {
"Owner": "001AC",
"Record":"0121n"
}
}
I would like to be able to pass the first int and get back array for that number.
For example if I pass 15 I get
{
"Owner": "009AC",
"Record":"0120Pc"
}
I tried foreach loop but cannot set specific value for the first int
If I assign $data = json
then $date[15] didn't work
$data->15 also didn't work
I did also use the json decode and was able to print an array but wasn't able to get a single value
Any help would be great, I did spend all day and still cannot get an answer.
Thank you
No comments:
Post a Comment