-
Notifications
You must be signed in to change notification settings - Fork 1
Quick Start
MohammadAli Arjomand edited this page Jul 29, 2023
·
2 revisions
For start, use Pouria
class
use Arjomand\PouriaValid\Pouria;
And create new instance of Pouria
class and pass $_REQUEST
, $_POST
, $_GET
or any array to constructor
$pouria = new Pouria($_REQUEST);
Now, you can set conditions for array index, like ...
$pouria->conditions([
"name" => [
"required",
"min=5",
"max=16"
]
]);
In this example, name
is required, minimum length is 5 and maximum length is 16 characters
For check to conditions is true
or false
, use check
property, like ...
echo $pouria->check ? "Name is valid" : "Name is invalid";
MIT License, Copyright (c) 2023 MohammadAli Arjomand