官方实例
在数组中搜索值 “Mark” ,并输出一些文本:
<?php
$people = array("Bill", "Steve", "Mark", "David");
if (in_array("Mark", $people))
{
echo "匹配已找到";
}
else
{
echo "匹配未找到";
}
?>
运行实例
匹配已找到
$noarr = ["nbsp","quot"];
foreach ($tagsArr as $key => $value) {
if (!in_array($value, $noarr)){
$datas[] = $value;
}
}