I have this multidimensional array:
$serviceTimes = Array (
[0] => Array ( [0] => PM1900 [1] => 7:00pm )
[1] => Array ( [0] => PM1900 [1] => 7:00pm )
[2] => Array ( [0] => PM1415 [1] => 2:15pm )
[3] => Array ( [0] => PM1919 [1] => 7:19pm )
[6] => Array ( [0] => PM2020 [1] => 8:20pm )
)
But I am unable to sort the array on the [0] element. This does not work:
array_multisort( $serviceTimes[0], SORT_ASC, $serviceTimes );
nor does this work
array_multisort( $serviceTimes[][0], SORT_ASC, $serviceTimes );
Any thoughts?
Ideally and ultimately, this is what I am looking to produce:
Array (
[0] => 2:15pm )
[1] => 7:00pm )
[2] => 7:00pm )
[3] => 7:19pm )
[4] => 8:20pm )
)
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…