php in_array用法一例

发布时间:2020-06-14编辑:脚本学堂
php in_array用法一例,供大家学习参考。

示例代码:
 

<?php
/**
* php in_array简单示例
* site www.jb200.com
*/
$people = array("Peter", "Joe", "Glenn", "Cleveland");

if (in_array("Glenn",$people))
  {
  echo "It's Here.";
  }
else
  {
  echo "where you going?";
  }
?>

Output:
It's Here.