How does php determine whether the URL or string contains a value in the array?

how does php determine whether the URL or string contains a value in the array? For example, in the following code, when the "Android" in the array is placed in the first position (that is, in front of the character "filter"), the normal return value is 1, but when the "Android" in the array is placed in the second or later position, the return value is set to 0, but the desired result is to return 1 as long as the array contains the value of "Android". How to modify the code?

<?php
header("Content-Type: text/html; charset=UTF-8");
$arr=array("","","");//,
$str="";
foreach($arr as $key){
    if(strstr($str,$key)){//.str,.
        echo 1;
        exit;
    }else{
        echo 0;
        exit;
    }
}
?>
Php
Mar.26,2022

$arr = [];
$str = '';
$result = 0;
foreach($arr as $item){
    if(strpos($str,$item)!==false){
        $result = 1;
        break;
    }
}

echo $result;
MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1b3c601-2c2f3.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1b3c601-2c2f3.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?