主页
PHP
PHP in_array() 函数
tryphp_func_in_array2
运行 ❯
×
更改方向
保存代码
更改主题
<?php $people = array("Peter", "Joe", "Glenn", "Cleveland", 23); if (in_array("23", $people, TRUE)) { echo "Match found
"; } else { echo "Match not found
"; } if (in_array("Glenn",$people, TRUE)) { echo "Match found
"; } else { echo "Match not found
"; } if (in_array(23,$people, TRUE)) { echo "Match found
"; } else { echo "Match not found
"; } ?>