fork download
  1. <?php
  2.  
  3. $arr = [['z', 'b', 'h', 'd', 'e'], ['b', 'c', 'r', 'i', 'l'], ['q', 'w', 'y', 'u', 's']];
  4.  
  5. array_multisort(array_column($arr, 0), SORT_ASC, $arr);
  6.  
  7. print_r($arr);
Success #stdin #stdout 0.01s 82880KB
stdin
Standard input is empty
stdout
Array
(
    [0] => Array
        (
            [0] => b
            [1] => c
            [2] => r
            [3] => i
            [4] => l
        )

    [1] => Array
        (
            [0] => q
            [1] => w
            [2] => y
            [3] => u
            [4] => s
        )

    [2] => Array
        (
            [0] => z
            [1] => b
            [2] => h
            [3] => d
            [4] => e
        )

)