PHP code example of tleckie / validator

1. Go to this page and download the library: Download tleckie/validator library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

tleckie / validator example snippets




leckie\Validator\ValidatorFactory;

$validator = new ValidatorFactory();

$validator->boolValidator()->isValid('true'); // false

$validator->emailValidator()->isValid('[email protected]'); // true

$validator->floatValidator()->isValid(1.22); // true

$validator->intValidator()->isValid(1.22); // false

$validator->numericValidator()->isValid(1.22); // true

$validator->stringValidator()->isValid("1.22"); // true

$validator->uriValidator()->isValid("https://hostname.dev/path/"); // true