in_array

(PHP4 )

in_array -- Return true if a value exists in an array

Description

bool in_array (mixed needle, array haystack)

Searches haystack for needle and returns true if it is found in the array, false otherwise.

Példa 1. In_array() example

  1 
  2 $os = array ("Mac", "NT", "Irix", "Linux");
  3 if (in_array ("Irix", $os))
  4     print "Got Irix";
  5