0

Here is my array

array (size=167)
  0 => 
    array (size=6)
      'id' => string '41' (length=2)
      'creation_date' => string '04/01/16' (length=8)
      'nom' => string 'toto' (length=4)
      'product' => string ' (length=70)
      'type' => string 'En cours' (length=8)
      'etat' => string 'Projet classique' (length=16)
  1 => 
    array (size=6)
      'id' => string '43' (length=2)
      'creation_date' => string '04/01/16' (length=8)
      'nom' => string 'poikl' (length=5)
      'product' => string '' (length=70)
      'type' => string 'En cours' (length=8)
      'etat' => string 'Projet classique' (length=16)
  2 => 
    array (size=6)
      'id' => string '44' (length=2)
      'creation_date' => string '04/01/16' (length=8)
      'nom' => string 'mac' (length=3)
      'product' => string '' (length=70)
      'type' => string 'En cours' (length=8)
      'etat' => string 'Projet classique' (length=16)
  ...

I want to sort in alphabetical order this array in PHP looking for the 'nom' key, so i want my array to look exactly the same but ordered by the 'nom' key . I've not find in my research a situation like this so i'm deeply sorry to ask a maybe obvious question

  • 2
    [`array_multisort($array, array_column($array,'nom'))`](http://php.net/manual/en/function.array-multisort.php) – apokryfos Jun 15 '17 at 09:43
  • Also https://stackoverflow.com/questions/10000005/php-sort-array-by-field – apokryfos Jun 15 '17 at 09:46
  • 1
    Possible duplicate of [Sort Multi-dimensional Array by Value](https://stackoverflow.com/q/2699086/6521116) – LF00 Jun 15 '17 at 09:53

0 Answers0