Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PHP

php check if some string contains from array

$string = 'my domain name is website3.com';
foreach ($owned_urls as $url) {
    //if (strstr($string, $url)) { // mine version
    if (strpos($string, $url) !== FALSE) { // Yoshi version
        echo "Match found"; 
        return true;
    }
}
echo "Not found!";
return false;
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #php #check #string #array
ADD COMMENT
Topic
Name
5+8 =