Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我想写一个条件来根据在另一个数组上找到的数组值采取行动。它目前无法正常工作。
$Main = array('Ami', 'Tumi', 'Amra'); $Search = array('Jani', 'Ami', 'Kara'); if(in_array($Search, $Main)){ echo "Found"; }
你可以试试这个。
$CheckNow = !empty(array_intersect($Main, $Search)); if ($CheckNow) { # code... }