PHP in_array() 函数

  实例 1

  使用所有的参数:

  <?php

  $people = array("Peter", "Joe", "Glenn", "Cleveland", 23);

  if (in_array("23", $people, TRUE))

  {

  echo "Match found
";

  }

  else

  {

  echo "Match not found
";

  }

  if (in_array("Glenn",$people, TRUE))

  {

  echo "Match found
";

  }

  else

  {

  echo "Match not found
";

  }

  if (in_array(23,$people, TRUE))

  {

  echo "Match found
";

  }

  else

  {

  echo "Match not found
";

  }

  ?>