In PHP, I have learned that to be able to get values from an object is to do something like this:
$objResult->{"RESP"}->{"DATA"}->{"F_NAME"}
However, for the data below, how will I be able to get the name "NO_1"? Since its in an array, I want to be able to extract the data in it, and I'm thinking of getting the name of it first.
{
"SAMPLE": [
{
"NO_1": [
{
"RESULT": [
{
"NUMBER": 1,
"F_NAME": "JOHN",
"L_NAME": "SMITH"
},
{
"NUMBER": 2,
"F_NAME": "WILL",
"L_NAME": "JONES"
}
]
}
]
},
{
"NO_2": [
{
"RESULT": [
{
"NUMBER": 3,
"F_NAME": "MARY",
"L_NAME": "JANE"
},
{
"NUMBER": 4,
"F_NAME": "NEIL",
"L_NAME": "STRONG"
}
]
}
]
}
]
}
Any ideas?