PHP code example of rlanvin / php-form

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

    

rlanvin / php-form example snippets


// create the form with rules
$form = new Form\Validator([
    'name' => ['
    // $_POST data is valid
    $form->getValues(); // returns an array of sanitized values
}
else {
   // $_POST data is not valid
   $form->getErrors(); // contains the errors
   $form->getValues(); // can be used to repopulate the form
}


JSON
{
    "lanvin/php-form": "2.*"
    }
}