<?php $arr = [ ['company' => 'A', 'weight' => 4.6], ['company' => 'B', 'weight' => 1.7], ['company' => 'C', 'weight' => 3.7], ['company' => 'D', 'weight' => 13.2], ['company' => 'E', 'weight' => 1.85], ['company' => 'F', 'weight' => 2.07], ]; usort($arr, fn($a, $b) => $b['weight'] <=> $a['weight']); var_export($arr);
You have javascript disabled. You will not be able to edit any code.