Array_multisort is used to sort several arrays at once or sort multidimensional array by one or more dimensions. In this the associative (string) keys will be maintained but numeric keys will be reindexed.
e.g :
<?php
array1 = array(23,60,50,70);
array2 = array(2,3,6,5);
array_multisort(array1 , $array2);
Output:
1: var_dump(array1);
array(4)
{
[0] => int(23)
[1] => int(50)
[2] => int(60)
[3] => int(70)
}
var_dump(array2);
array(4)
{
[0] => int(2)
[1] => int(6)
[2] => int(3)
[3] => int(5)
}
?>