Validation component

You can validate email, string, array and others.

Email

$res = Valid::email('solital@email.com');

/* Return `string` if true or `null` if false */
pre($res);

Number

You can validate whether a number is int orfloat.

$res = Valid::number(12.5);

/* Return `int` or `float` if true or `null` if false */
pre($res);

Null

$res = Valid::isNull(null);

/* Return bool */
pre($res);

Lowercase

You can validate a string if it is lowercase. If not, the isLower method will convert the string to lowercase.

$res = Valid::isLower('SOLITAL');

/* Return string */
pre($res);

Uppercase

You can validate a string if it is uppercase. If not, the isUpper method will convert the string to uppercase.

$res = Valid::isUpper('solital');

/* Return string */
pre($res);

Base64

Checks whether a variable is Base64-type encryption.

$hash = base64_encode("test");
$res = Valid::isBase64($hash);

/* Return bool */
pre($res);

Identical

Checks if one variable is identical to another.

$res = Valid::identical("foo", "foo");

/* Return bool */
pre($res);


Built with MkDocs.