Created
February 1, 2023 03:31
-
-
Save dlh01/e380afb499df2f3211aed1ce4123e419 to your computer and use it in GitHub Desktop.
Laminas Validator Extensions example
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$valid = new \Alley\Validator\ValidatorByOperator('REGEX', '/^foo/'); | |
$valid->isValid('foobar'); // true | |
$valid = new \Alley\Validator\ValidatorByOperator('NOT IN', ['bar', 'baz']); | |
$valid->isValid('bar'); // false | |
$valid = new \Alley\Validator\ValidatorByOperator('!==', 42); | |
$valid->isValid(43); // true |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment