PHP code example of celiovmjr / smartvalidator
1. Go to this page and download the library: Download celiovmjr/smartvalidator 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/ */
celiovmjr / smartvalidator example snippets
// Basic usage example
$data = [
'name' => 'John Doe',
'email' => '[email protected]',
'age' => 30,
];
$rules = [
'name' => 'string|atedData = $validator->getValidated();
// $validatedData will contain the validated data according to the specified rules
public function __construct(array|object $data, array $rules)
public function getValidated(): array