Thread:Project:Support desk/Working data returned in JSON with PHP

I'm working on a thing where I use PHP and mediawiki API to get all the categories a certain searchword belongs to in Wikipedia. The result is returned in JSON format. There is only one problem. When Mediawiki return its result in XML, the first, and only, child of the "pages"-element is the "page" element. Working with JSON instead, the first and only child of the pages object is the unique pageid! For example 5200013 for "C", or 4269567 for "Dog".

In PHP, using json_decode(returned_json, true) will return an array, where every property is converted to an element(or a inner array) in an associative array. So the "query"object is reached by "['query']" and the "pages" object by "['query']['pages']", but when PHP reaches the "5200013" object, it does create an unnamed element and sets its index to 5200013, which makes it very hard to reach dynamicly. If that object was renamed "page", like in XML, it would be a hundred times easier to work with.

(I hope you get me, as you might understand, english is not my native language:) )