Manuel PHP

Précédent

 

Suivant

in_array

in_array -- Retourne vrai si une valeur appartient à un tableau

Description

bool in_array(mixed needle, array haystack);

Recherche needle dans haystack et retourne vrai si il síy trouve, ou faux sinon.

Exemple 1. Exemple in_array()

$os = array("Mac", "NT", "Irix", "Linux");
if (in_array("Irix", $os))
       print "Irix trouve";
      

Note: Cette fonction a été ajoutée dans PHP 4.0.

Précédent

Sommaire

Suivant

extract

Chapitre

key