<?php $array = [ ["id" => 10, "hits" => 80], ["id" => 14, "hits" => 50], ["id" => 15, "hits" => 700], ["id" => 18, "hits" => 200], ]; usort( $array, fn($a, $b) => [$a['id'] !== 18, $a['hits']] <=> [$b['id'] !== 18, $b['hits']] ); var_export($array);
You have javascript disabled. You will not be able to edit any code.