Red Wingate wrote:
> while (list($key,$dim2) = each ($A)) {
> uksort ( $A[ $key ] , "strcasecmp");
> }
> print_r ($A);
>
> $dim2 will not change $A[ $key ], so you will have to change your
> script to alter them directly.
>
> -- red
>
Like thus:
uksort ($myArray, "strcasecmp");
foreach (arr
while (list($key,$dim2) = each ($A)) {
uksort ( $A[ $key ] , "strcasecmp");
}
print_r ($A);
$dim2 will not change $A[ $key ], so you will have to change your
script to alter them directly.
-- red
[]
> I have this little code.
> I want all arrays sorted case insensitive key order, but only
I have this little code.
I want all arrays sorted case insensitive key order, but only the first
dimension gets key sorted properly
Thanks
--
Richard A. DeVenezia
array ( "x" => 1, "Z" => 2, "y" => 3)
, "b" => array ( "z" => 1, "Y" => 2, "x" => 3)
, "A" => array ( "z" => 1, "X" => 2)
);
print_r
3 matches
Mail list logo