<?php $array = array( 'fruit1' => 'pomme', 'fruit2' => 'orange', 'fruit3' => 'raisin', 'fruit4' => 'pomme', 'fruit5' => 'pomme');
// Cette boucle affiche toutes les clés // dont la valeur vaut 'pomme'
while ($fruit_name = current($array)) { if ($fruit_name == 'pomme') { echo key($array) . '<br />'; } next($array); } ?>
|