Webiny\Component\StdLib\StdObject\StringObject\ValidatorTrait::containsAny PHP Method

containsAny() public method

If any of given $char is present, true is returned.
public containsAny ( array | ArrayObjec\ArrayObject $needle ) : boolean
$needle array | ArrayObjec\ArrayObject Array of characters you wish to check
return boolean True if current string contains the $needle. Otherwise false is returned.
    public function containsAny($needle)
    {
        $needle = StdObjectWrapper::toArray($needle);
        foreach ($needle as $char) {
            if ($this->contains($char)) {
                return true;
            }
        }
        return false;
    }