par
moogli » 11 avr. 2013, 20:29
salut,
j'ai corrigé les données manquantes, le code peux être ainsi:
<?php
$tab = [
'ref_porte' => ['0' => 'porte bureau DG', '1' => 'porte bureau DG', '2' => 'porte bureau DG', '3' => 'porte bureau DG'],
'longueur' => ['0' => 'K', '1' => 'K', '2' => 'K', '3' => 'K'],
'bouton' => ['0' => 'k', '1' => 'K', '2' => 'K', '3' => 'K'],
'ref_cylindre' => ['0' => 'DK / 30 - 30', '1' => 'DK / 30 - 30', '2' => 'DK / 30 - 30', '3' => 'DK / 30 - 30']
];
foreach ($tab as $key => $val) {
echo $key, ' : ', implode(', ', $val), '<br />';
}
résultat
ref_porte : porte bureau DG, porte bureau DG, porte bureau DG, porte bureau DG
longueur : K, K, K, K
bouton : k, K, K, K
ref_cylindre : DK / 30 - 30, DK / 30 - 30, DK / 30 - 30, DK / 30 - 30
après si tu précise plus ta demande il y a surement moyen de faire mieux, par exemple afficher sous forme de tableaux etc etc
@+
salut,
j'ai corrigé les données manquantes, le code peux être ainsi:
[php]<?php
$tab = [
'ref_porte' => ['0' => 'porte bureau DG', '1' => 'porte bureau DG', '2' => 'porte bureau DG', '3' => 'porte bureau DG'],
'longueur' => ['0' => 'K', '1' => 'K', '2' => 'K', '3' => 'K'],
'bouton' => ['0' => 'k', '1' => 'K', '2' => 'K', '3' => 'K'],
'ref_cylindre' => ['0' => 'DK / 30 - 30', '1' => 'DK / 30 - 30', '2' => 'DK / 30 - 30', '3' => 'DK / 30 - 30']
];
foreach ($tab as $key => $val) {
echo $key, ' : ', implode(', ', $val), '<br />';
}[/php]
résultat
[quote]ref_porte : porte bureau DG, porte bureau DG, porte bureau DG, porte bureau DG
longueur : K, K, K, K
bouton : k, K, K, K
ref_cylindre : DK / 30 - 30, DK / 30 - 30, DK / 30 - 30, DK / 30 - 30[/quote]
après si tu précise plus ta demande il y a surement moyen de faire mieux, par exemple afficher sous forme de tableaux etc etc
@+