PHP code example of felizardochirindja / radar

1. Go to this page and download the library: Download felizardochirindja/radar 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/ */

    

felizardochirindja / radar example snippets


use Radar\Validators\RequiredData;

$nonRequiredData = new NonRequiredData();
$nonRequiredData->setLenght(2, 6, 'apenas caracteres entre 2 e 6');

$passwordData = $this->nonRequiredData->validateString('', 'password invalida');

var_dump($passwordData);

/**
 * resultado
 * 
 * [
 *      'chars' => '',
 *      'error' => 'apenas caracteres entre 2 e 6'
 * ]
*/

use Radar\Validators\RequiredData;

$idateName('felizardo', 'nome invalido');

var_dump($nameData);

/**
 * resultado
 * 
 * [
 *      'name' => 'felizardo',
 *      'error' => ''
 * ]
*/