Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PHP

php sort array by value

$price = array();
foreach ($inventory as $key => $row)
{
    $price[$key] = $row['price'];
}
array_multisort($price, SORT_DESC, $inventory);
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #php #sort #array
ADD COMMENT
Topic
Name
4+5 =