这是我的数组$data
:如何检查数值是否在我的数组中?
array(3) {
[0]=>
string(4) "icon"
[1]=>
string(6) " image"
[2]=>
string(12) " description"
}
我试图找出一个值在我的数组现有:
if (in_array("description", $data))
{
echo "Match found";
}
else
{
echo "Match not found";
}
但我的结果是Match not found
我很茫然。
Downvoted,因为它显示在自我解决很少的努力,并在很大程度上是无助于未来的读者。请考虑删除此问题。 – mickmackusa