I’m looking at http://www.php.net/manual/en/array.sorting.php as a reference. I’m trying to sort the $_POST by the keys. This is what I am trying, but it only prints “1”. What else needs to happen, or what is missing? Thank.
<?php
$data = krsort($_POST);
print_r( $data );
?>
The return value of
ksort()is true or value, whether or not the sorting was successful, instead of the sorted array.Try: