This question already has an answer here:
- How can I sort arrays and data in PHP? 10 answers
I want to sort a multidimensional array in numerical order bu second value of each item.
This is array:
$vulc = array(
array('s',3),
array('s',5),
array('s',2)
);
and i want this output:
$vulc = array(
array('s',5),
array('s',3),
array('s',2)
);
I'm tried this:
foreach ($vulc as $key => $row) {
$distance[$key] = $row[2];
}
array_multisort($distance, SORT_ASC, $vulc);
but doesn't work :( please help me and not suggest to see other answer... usually other answer are too difficult :(
</div>