In the html page I can get any one of the below mentioned jsons, now in order to know which json is recieved I need to check the depths of these json objects. can somebody suggest a way to get the depth of json object in PHP.
The two formats of the json are mentioned below:
{
"Category": {
"name" : "Camera",
"productDetails" : {
"imageUrl" : "/assets/images/product1.png",
"productName" : "GH700 Digital Camera",
"originalPrice" : 20000,
"discountPrice" : 16000,
"discount" : 20
}
}
and
{
"city" : {
"cityname": "ABC",
"Category": {
"name" : "Camera",
"productDetails" : {
"imageUrl" : "/assets/images/product1.png",
"productName" : "GH700 Digital Camera",
"originalPrice" : 20000,
"discountPrice" : 16000,
"discount" : 20
}
}
}