PHP code example of lizus / php-error
1. Go to this page and download the library: Download lizus/php-error 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/ */
lizus / php-error example snippets
use \Lizus\Error\PHPError;
use function \Lizus\Error\{is_error};
$err=new PHPError();
$err->add_error('email_error','please enter email address');
$err->add_error('email_error','must has `@` in email address');
$err->add_error('name_error','need more than 4 characters');
$err->remove_error('sex_error');
var_dump($err->get_all_errors());