<html>
<body>
<h3 style="color: skyblue;">in_array() function example in PHP</h3>
<?php
$people = array("Arti", "Anamika", "Pallavi", "Pratibha", 25);
if (in_array("25",$people, TRUE))
{
echo "Record found<br />";
}
else
{
echo "Record not found<br />";
}
if (in_array("Pratibha",$people, TRUE))
{
echo "Record found<br />";
}
else
{
echo "Record not found<br />";
}
if (in_array(25,$people, TRUE))
{
echo "Record found<br />";
}
else
{
echo "Record not found<br />";
}
?>
</body>
</html>
|