Hi,
I have a database query returning the following array structure;
Array
(
[0] => Array
(
[Category] => Array
(
[id] => 9
[name] => ABC
)
[Ds] => Array
(
[ds_id] => 39
)
)
[1] => Array
(
[Category] => Array
(
[id] => 10
[name] => DEF
)
[Ds] => Array
(
[ds_id] => 40
)
)
)
I need to change the structure of the array(to feed a json object) to this (dynamically);
Array
(
[0] => Array
(
[id] => 9
[name] => ABC
[ds_id] => 39
)
[1] => Array
(
[id] => 10
[name] => DEF
[ds_id] => 40
)
)
I am embarassed to say i have spent the best part of two days mucking around with a multitude of recursive functions to no avail. At best i completely flatten the array at worst i end up with a complete mishmash.
I tried to set up a php debugger to watch the process but after 3 days of trying i came to the conclusion it was not compatible with my working environment. I am still using php 4.4.9.
Any assistance would be greatly appreciated.