Part on Validator Class finished and Part 2 finished

This commit is contained in:
Patryk Hegenberg 2022-12-20 21:23:29 +01:00
parent ef90228439
commit 20aee0812f
2 changed files with 17 additions and 5 deletions

14
Validator.php Normal file
View file

@ -0,0 +1,14 @@
<?php
class Validator
{
public static function string($value, $min = 1, $max = INF)
{
$value = trim($value);
return strlen($value) >= $min && strlen($value) <= $max;
}
public static function email($value)
{
return filter_var($value, FILTER_VALIDATE_EMAIL);
}
}