Answers for "php array sort alphabetically by key case insensitive"

PHP
2

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
0

php array order alphabetically

// SORT ARRAY ALPHABETICALLY
$frutas = array("limón", "naranja", "banana", "albaricoque");
sort($frutas);
foreach ($frutas as $clave => $valor) {
    echo "frutas[" . $clave . "] = " . $valor . "n";
}
Posted by: Guest on January-13-2022

Code answers related to "php array sort alphabetically by key case insensitive"

Browse Popular Code Answers by Language