I need to get the keys of a JSON. How can I achieve that?
For example,
{
"empId":"123",
"emp_name":"asda",
"emp_address":"skdjahskdga"
}
In the above code, I need to get empId,emp_name and emp_address.
Suppose it is an array like this,
{"products":[{
"empId":"123",
"emp_name":"asda",
"emp_address":"skdjahskdga"
},
{
"empId":"123",
"emp_name":"asda",
"emp_address":"skdjahskdga"
}]}
I need to get products.empId, products.emp_name, products.emp_address.
If there is one more level, say employees array contains products array, and in turn products contains empId,emp_name and emp_address, I need to get employees.product1.empId, employees.product1.emp_name and employees.product1.emp_address, and so on.. Please let me know how to achieve this.