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 www.php.net #
 
PREVIOUS NEXT
Tagged: #php #sort #array
ADD COMMENT
Topic
Name
1+2 =