PHP code example of gavinggordon / input-validator

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

    

gavinggordon / input-validator example snippets


// if passed validation 
if( $validated === true ) {

  // retrieve an associative array of inputs
  $data = $validator->getInputs();
  
}

// if has errors 
if( is_array( $validated ) ) {

  // show an array containing messages for
  // each input which did not pass validation.
  var_dump( $validated );
  
}