How can I sort an array keeping the correlation between the index and value?
Otherwise it functions the same: asort($array);
<?php
$myworld = array("a"=>"php","b"=>"learning","c"=>"i'm");
asort($myworld);
print_r($myworld);
?>
Which prints:
Array
(
[c] => i'm
[b] => learning
[a] => php
)
Comment on this Question and Answer >>>
ASK A QUESTION
More arrays PHP Questions
How can I create an array of the letters of the alphabet?when i fetch the record in the database but they skip first record in the database
How do I return all the values in an array?
How do I sort an array by key?
I want to invert my array, can I do this?
