I have this array :
$order_list = array ( array ("081", "01203", "2", "12000"),
array ("002", "01204", "8", NULL),
array ("021", "01207", "8", NULL),
array ("081", "01206", "8", NULL),
array ("043", "01205", "10", "14000"));
and I want to sort (ascending) that array based on the first value (081, 002, 021, 081 and 043). so it will look like this :
array ( array ("002", "01204", "8", NULL),
array ("021", "01207", "8", NULL),
array ("043", "01205", "10", "14000"),
array ("081", "01203", "2", "12000"),
array ("081", "01206", "8", NULL));
how to do that? I learned about asort()
and ksort()
, but it seems that only works for associative array, not multidimensional array.