Tableaux PHP
thomas3347
Messages postés
18
Statut
Membre
-
Yoan Messages postés 11905 Statut Modérateur -
Yoan Messages postés 11905 Statut Modérateur -
Bonjour,
Je souhaite obtenir ça en PHP :
Savez-vous comment faire ? Merci
Je souhaite obtenir ça en PHP :
Array
(
[Centrale electrique] => Chantier
(
[0] => Chantier
[1] => 01
)
[Rayon] => Chantier
(
[0] => Chantier
[1] => 01
)
)
Savez-vous comment faire ? Merci
Configuration: Windows XP Internet Explorer 7.0
4 réponses
-
C'est un tableau à deux dimensions :
$colonne1=array('Chantier','01'); $colonne2=array('Chantier','01'); $tableau=array('Centrale electrique'=>$colonne1,'Rayon'=>$colonne2);
cf http://www.phpdebutant.org/article11.php -
-
J'obtiens ça :
Array ( [Centrale electrique] => Array ( [0] => Chantier [1] => 01 ) [Rayon] => Array ( [0] => Chantier [1] => 01 ) )
Je voudrais que :
$array['Centrale electrique'] = Chantier et non pas :
$array['Centrale electrique'] = Array -
Bah c'est encore plus simple alors, c'est un vecteur :
$array('Centrale electrique'=>'Chantier,'Rayon'=>'Chantier');