<?php $yourArray = [ ['item1' => 80], ['item2' => 25], ['item3' => 85], ]; usort( $yourArray, fn(array $a, array $b): int => reset($a) /* get the first array elements from $a */ <=> /* <--- the spaceship operator */ reset($b) /* and from $b for comparison */ ); print_r($yourArray);
You have javascript disabled. You will not be able to edit any code.