Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PHP

sort array php by key

$price = array_column($inventory, 'price'); //price is a key for the sort
array_multisort($price, SORT_DESC, $inventory);
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #sort #array #php #key
ADD COMMENT
Topic
Name
1+2 =