I have a ldap request that returns an array, however the returned array is full of "counts" and odd pointers, as this application is an API designed to be used with Javascript on mobile devices, the less text there is the better.
What is the most efficient way to strip out all the values that don't have the key count? As well as the ones that just seem to be saying what the keys are (eg [0] => cn)?
Array
(
[status] => OK
[count] => 4
[results] => Array
(
[count] => 3
[0] => Array
(
[cn] => Array
(
[count] => 1
[0] => James Bee
)
[0] => cn
[umanprimaryou] => Array
(
[count] => 1
[0] => Awesome School
)
[1] => umanprimaryou
[ou] => Array
(
[count] => 2
[0] => School of Awesome
[1] => Faculty of Engineering
)
etc...
Aiming for
Array
(
[status] => OK
[results] => Array
(
[0] => Array
(
[cn] => Array
(
[0] => James Bee
)
[umanprimaryou] => Array
(
[0] => Awesome School
)
[ou] => Array
(
[0] => School of Awesome
[1] => Faculty of Engineering
)
etc...
For further explanation I am wanting to unset all the [count] => value pairs and if possible the values such as [0] => cn in the results array.