All,
I have the following JSON Request that comes through a function call in PHP. As evident, each URL can belong to one or more catids.
How can I loop through the JSON request and create an associative array that denotes which catid has how many URLs in it.
Ex: $arr = array("140"=>3, "141"=>4, "144"=>3)
JSON Request:
{
"header": {
"action": "loadurls"
},
"data": [
{
"url": "godaddy.com",
"catids": [
141
]
},
{
"url": "cnn.com",
"catids": [
140
]
},
{
"url": "zdnet.com",
"catids": [
140
]
},
{
"url": "yahoo.com",
"catids": [
140,141,144
]
},
{
"url": "google.com",
"catids": [
141,144
]
},
{
"url": "rediff.com",
"catids": [
141
]
},
{
"url": "apple.com",
"catids": [
144
]
}
]
}
Thanks