How can I do sorting of associative multidimensional array by keys, in PHP?

Ksort($data) php.net/manual/en/function.ksort.php Also from the comments in the PHP documentation: Here is a function to recursively sort multidimentional arrays by key: function deep_ksort(&$arr) { ksort($arr); foreach ($arr as &$a) { if (is_array($a) &&! Empty($a)) { deep_ksort($a); } } }.

Ksort($data); php.net/manual/en/function.ksort.php Also from the comments in the PHP documentation: Here is a function to recursively sort multidimentional arrays by key: function deep_ksort(&$arr) { ksort($arr); foreach ($arr as &$a) { if (is_array($a) &&! Empty($a)) { deep_ksort($a); } } }.

This function won't run recursively... when it returns, only the keys of the outer-most array will be sorted. – Christopher Armstrong Aug 18 at 20:53 @Christopher Armstrong I just added a function "deep_keysort" to handle multidimensional did you see it? – amosrivera Aug 18 at 20:54 I see it now.

Changed my vote to +1 – Christopher Armstrong Aug 18 at 20:58 Nice piece of code, thanks! – Johnny Aug 18 at 21:15.

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions