protected function containString($haystack, $needle, $insensitive = true, $findWords = true)
    {
        if (!is_array($needle)) {
            $needle = array($needle);
        }

        foreach ($needle as $currNeedle) {
            if ($findWords) {
                 $found = $this->wordPos($haystack, $currNeedle, $insensitive) !== false;
            } else {
                if ($insensitive) {
                    $found = stripos($haystack, $currNeedle) !== false;
                } else {
                    $found = strpos($haystack, $currNeedle) !== false;
                }
            }

            if ($found) {
                return true;
            }
        }

        return false;
    }
protected function containString($haystack, $needle, $insensitive = true, $findWords = true)
    {
        if (!is_array($needle)) {
            $needle = array($needle);
        }

        foreach ($needle as $currNeedle) {
            if ($findWords) {
                 $found = $this->wordPos($haystack, $currNeedle, $insensitive) !== false;
            } else {
                if ($insensitive) {
                    $found = stripos($haystack, $currNeedle) !== false;
                } else {
                    $found = strpos($haystack, $currNeedle) !== false;
                }
            }

            if ($found) {
                return true;
            }
        }

        return false;
    }
protected function containString ( $ haystack , $ needle , $ insensitive = true , $ findWords = true ) { if ( ! is_array ( $ needle ) ) { $ needle = array ( $ needle ) ; } foreach ( $ needle as $ currNeedle ) { if ( $ findWords ) { $ found = $ this -> wordPos ( $ haystack , $ currNeedle , $ insensitive ) !== false ; } else { if ( $ insensitive ) { $ found = stripos ( $ haystack , $ currNeedle ) !== false ; } else { $ found = strpos ( $ haystack , $ currNeedle ) !== false ; } } if ( $ found ) { return true ; } } return false ; }
Find if one or more substring is contained in a string.
@access protected
@param string $haystack The string to search in.
@param mixed $needle The string to search for. Can be a string or an array of strings if multiples values are to
be searched.
@param boolean $insensitive (optional) Determines if we do a case-sensitive search (false) or a case-insensitive
one (true).
@param boolean $findWords (optional) Determines if the needle should match a word to be found. For example "Bar"
would not be found in "FooBar" when true but would be found in "Foo Bar". When set to false, the needle can be
found anywhere in the haystack.
@return boolean Returns true if the needle (or one of the needles) has been found in the haystack, false
otherwise.
Find if one or more substring is contained in a string .