Search for an item in an array

Search for an item in an array using in_array.

<?php
$items = array(“php”, “asp”, “javascript”);

if (in_array(“php”, $items))
{
echo “found php in the array”;
}
else
{
echo “cannot find the search term”;
}
?>

LEAVE A REPLY

Please enter your comment!
Please enter your name here

*