<?php$people = array("Peter", "Joe", "Glenn", "Cleveland");This example is for search the keyword "Glenn" with the array named $people.
if (in_array("Glenn", $people)) { echo "Match found"; }else { echo "Match not found"; }?>
Reference:
http://us2.php.net/in_array
http://www.w3schools.com/php/func_array_in_array.asp
No comments :
Post a Comment