Answers for "php sort collection by value"

PHP
1

php sort array by value

$price = array();
foreach ($inventory as $key => $row)
{
    $price[$key] = $row['price'];
}
array_multisort($price, SORT_DESC, $inventory);
Posted by: Guest on June-19-2021

Code answers related to "php sort collection by value"

Browse Popular Code Answers by Language