php变量 $s = "1,2,3,4,5"如果判断5是否在$s中? 用in_array
1个回答
2013-11-24
展开全部
<?php
$s = "1,2,3,4,5";
$people = explode(",", $s);
if (in_array("5",$people))
{
echo "Found";
}
else
{
echo "Not found";
}
?>
$s = "1,2,3,4,5";
$people = explode(",", $s);
if (in_array("5",$people))
{
echo "Found";
}
else
{
echo "Not found";
}
?>
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询