I have an object BIRD and then there is [0] through [10] and each number has a subheading like \"bug\" or \"beetle\" or \"gnat\" and a value for each of those.
I could be wrong but try to use array_keys using a object as parameter. I believe that is possible in php.
http://php.net/manual/en/function.array-keys.php