
<HTML>
<HEAD><TITLE>Programmation Web avec PHP, Code VIII-3: Affichage si c'est un tableau </TITLE></HEAD>
<BODY>
<H1>Affichage d'un tableau aprs validation par is_array</H1>
<PRE><BIG>
	// Fonction d'affichage
	function affichage($tableau)
	{
		if (is_array($tableau)) {
			while (list($cle, $val)=each($tableau)) {
				// voir le paragraphe consacr aux fonctions " each " et
				// " list " pour tous les dtails sur leur fonctionnement.
				echo $val."<br>";
			};
		} else {
			echo "Ceci n'est pas un tableau" ;
		} ;
	}

	// Initialisation tableau
	$tab[0]="bleu";
	$tab[1]="vert";
	$tab[2]="rouge";
	$tab[3]="jaune";
	$tab[4]="orange";
	$tab[5]="noir";

	// Affiche toutes les valeurs du tableau.
	affichage($tab);
</BIG></PRE>
<BR><HR><P><A href="menu.php3">Retourner au menu principal</A>&nbsp;&nbsp;<A href="array_is.php3.txt">Voir le source</A></P>
</BODY>
</HTML>
