Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PHP

php sort array by specific key


usort($array, function ($a, $b) {
  return ($a['specific_key'] < $b['specific_key']) ? -1 : 1;
});
 
PREVIOUS NEXT
Tagged: #php #sort #array #specific #key
ADD COMMENT
Topic
Name
3+7 =