Answers for "php asort by key"

PHP
10

php sort array by key

$weight = [
    'Pete' => 75, 
    'Benjamin' => 89,
    'Jonathan' => 101
  ];  	
  ksort($weight);
Posted by: Guest on December-04-2019
0

php array sort by key

ksort(array &$array, int $sort_flags = ?): int
Posted by: Guest on September-06-2021

Browse Popular Code Answers by Language