PHP code example of muhammadsiyab / form_validation
1. Go to this page and download the library: Download muhammadsiyab/form_validation 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/ */
muhammadsiyab / form_validation example snippets
// Instantiate `Form_Validation` Class
$form_validation = new \FormValidation\Form_Validation();
// Array containing custom messages
// (Optional parameter, if not passed, default error messages will be used)
$messages = array(
'ld_name', 'field_label', ' $form_validation->set_error_markup('<li>', '</li>');
// Showing validation errors
$errors = $form_validation->show_validation_errors();
for ($i = 0; $i < count($errors); $i++) {
echo $errors[$i];
}
} else {
// Do something here
}