Stringy\Stringy::containsAll PHP Method

containsAll() public method

Returns true if the string contains all $needles, false otherwise. By default the comparison is case-sensitive, but can be made insensitive by setting $caseSensitive to false.
public containsAll ( array $needles, boolean $caseSensitive = true ) : boolean
$needles array Substrings to look for
$caseSensitive boolean Whether or not to enforce case-sensitivity
return boolean Whether or not $str contains $needle
    public function containsAll($needles, $caseSensitive = true)
    {
        if (empty($needles)) {
            return false;
        }
        foreach ($needles as $needle) {
            if (!$this->contains($needle, $caseSensitive)) {
                return false;
            }
        }
        return true;
    }