PHP MultiArray Sorting: This tutorial has covered the sorting process of multi-dimensional array, have a look on the examples of multi array sorting
PHP MultiArray Sorting: This tutorial has covered the sorting process of multi-dimensional array, have a look on the examples of multi array sortingPHP Array Sort Multidimensional
PHP provides array_multisort() function to sort more than one array at a time or multi-dimensional array. String keys will be maintained but the numeric keys will be re-indexed. A little description of array_multisort() is as follows:
| General Format | bool array_multisort ( array $arr [, mixed $arg[,...]] ) |
| Parameters | arr: an array, arg: optionally another array |
| Return Value | True/False |
Example 1:
<?php
$array1
=array(10,15,2,33,69);$array2
=array(2,33,55,856,1456);array_multisort(
$array1,$array2);print_r(
$array1);echo
"<br/>";print_r(
$array2);?>
Output: