So lets say I have an array that I want to organize by the keys. I thought I would just use ksort, but that does not work on the array below. Essentially I want to organize it so it would be A,R,Z. if I do ksort on this array it just returns 1.
array
(
[Z] => array
(
[dked] => asddadff
[fettyda] => dfdf
[feqed] => aasdf
)
[A] => array
(
[fdkded] => asddadff
[athgda] => dfdf
)
[R] => array
(
[fadfded] => asddadff
[adfthgda] => dfdf
[gadfhd] => aasdf
[gadfhd] => aasdf
)
)
if you are getting 1 as response, then you might be trying this
But ksort’s return value is true or false, not the sorted array.
This is enough.
ksortreceives the parameter as a reference, so you don’t want to assign it back.Read more here. ksort