Changer les clés d'un tableau multidimensionnel
Posté : 17 mars 2017, 13:06
Bonjour,
Bon, je m'en reviens vers vous après 3 heures sur le problème, je n'en peux plus...
J'ai un array que voici :
Je veux juste modifier les clés 0, 1, 2 et 3 par la valeur de l'id, pour avoir ca :
Aucun moyen d'y arriver, j'ai passé 3 heures en essayant avec les fonctions php sur les tableaux, des foreach...
Si vous avez une solution, je suis preneur !
Bon, je m'en reviens vers vous après 3 heures sur le problème, je n'en peux plus...
J'ai un array que voici :
Code : Tout sélectionner
D:\wamp64\www\index.php:9:
array (size=4)
0 =>
array (size=5)
'id' => string '3' (length=1)
'groupname' => string 'test' (length=4)
'cinema_group' => string '2' (length=1)
'cinema_name' => string 'test_1' (length=6)
'cinema_location' => string 'test_location1' (length=14)
1 =>
array (size=5)
'id' => string '4' (length=1)
'groupname' => string 'test' (length=4)
'cinema_group' => string '2' (length=1)
'cinema_name' => string 'test_2' (length=6)
'cinema_location' => string 'test_location2' (length=14)
2 =>
array (size=5)
'id' => string '5' (length=1)
'groupname' => string 'test' (length=4)
'cinema_group' => string '2' (length=1)
'cinema_name' => string 'test3' (length=5)
'cinema_location' => string 'test_location3' (length=14)
3 =>
array (size=5)
'id' => string '6' (length=1)
'groupname' => string 'test' (length=4)
'cinema_group' => string '2' (length=1)
'cinema_name' => string 'test4' (length=5)
'cinema_location' => string 'test_location4' (length=14)Code : Tout sélectionner
D:\wamp64\www\index.php:9:
array (size=4)
3 =>
...
4 =>
...
5 =>
...
6 =>
...Si vous avez une solution, je suis preneur !