Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PHP

php sort associative array by specific value

$price = array_column($inventory, 'price');

array_multisort($price, SORT_DESC, $inventory);
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #php #sort #associative #array #specific
ADD COMMENT
Topic
Name
1+8 =