redrat | OK j'ai trouvé google !!!
Code :
- <?php
- $fruits = array ( "fruits" => array ( "a" => "orange",
- "b" => "banane",
- "c" => "pomme"
- ),
- "nombre" => array ( 1,
- 2,
- 3,
- 4,
- 5,
- 6,
- ),
- "trou" => array ( "premier",
- 5 => "second",
- "troisième"
- )
- );
- // Exemples d'utilisations des tableaux ci-dessus
- echo $fruits["trou"][5]; // affiche "second"
- echo $fruits["fruits"]["a"]; // affiche "orange"
- unset($fruits["trou"][0]); // supprime "premier"
- // Créer un tableau multidimensionnel
- $juices["pomme"]["vert"] = "bon";
- ?>
|
|