Answers for "php foreach sort on specific key value example"

PHP
1

php sort array by specific key

usort($array, function ($a, $b) {
  return ($a['specific_key'] < $b['specific_key']) ? -1 : 1;
});
Posted by: Guest on January-22-2021

Code answers related to "php foreach sort on specific key value example"

Browse Popular Code Answers by Language