复制代码 代码如下:
<?php
$people = array("Peter", "Joe", "Glenn", "Cleveland");
if (in_array("Glenn",$people))
{
echo "Match found";
}
else
{
echo "Match not found";
}
?>
复制代码 代码如下:
<?php
$people = array("Peter", "Joe", "Glenn", "Cleveland", 23);
if (in_array("23",$people, TRUE))
{
echo "Match found<br />";
}
else
{
echo "Match not found<br />";
}if (in_array("Glenn",$people, TRUE))
{
echo "Match found<br />";
}
else
{
echo "Match not found<br />";
}if (in_array(23,$people, TRUE))
{
echo "Match found<br />";
}
else
{
echo "Match not found<br />";
}
?>
新闻热点
疑难解答