Home > Backend Development > PHP Tutorial > An example of php in_array usage

An example of php in_array usage

WBOY
Release: 2016-07-25 09:00:19
Original
1028 people have browsed it
An example of how to use php in_array for your reference.

Sample code:

<?php
/**
* php in_array简单示例
* site bbs.it-home.org
*/
$people = array("Peter", "Joe", "Glenn", "Cleveland");

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

Output: It's Here.



Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template