If I have the following:
{"hdrs": ["Make","Model","Year"],
"data" : [
{"Make":"Honda","Model":"Accord","Year":"2008"}
{"Make":"Toyota","Model":"Corolla","Year":"2008"}
{"Make":"Honda","Model":"Pilot","Year":"2008"}]
}
And I have a "hdrs" name (i.e. "Make"), how can I reference the "data" array instances? seems like data["Make"][0] should work...but unable to get the right reference
EDIT Sorry for the ambiguity..I can loop through "hdrs" to get each hdr name, but I need to use each instance value of "hdrs" to find all the data elements in "data" (not sure that is any better of an explanation). and I will have it in a variable "t" since it is JSON (appreciate the re-tagging) I would like to be able to reference with something like this: t.data[hdrs[i]][j]