Validation
MaplePHP - Validation is a PHP library designed to simplify the process of validating various data inputs. Whether you need to verify if a value is an email or phone number, check for minimum and maximum length constraints, or perform other common validation tasks, MaplePHP - Validation provides a convenient and straightforward solution for handling input validation.
Initiation
You will always initiate instace with the static method _val followed by a value you want to validate.
Check string length is more than or equal to 1
Check string length is more/equal than 1 and less/equal than 160
Check if is valid email
Check if is valid phone
Will allow only numbers and some characters like ("-", "+" and " ").
Validate Swedish social number (personnummer)
Validate Swedish organisation number
Validate credit card number
Validate VAT number
Check if is a color hex code
Check date and date format
Check date, date format and is between a range
Check if persons is at least 18 years old or older.
Check if is a valid domain name
Check if is a valid URL (http/https is required)
Check if is a valid DNS
Will check compare result against DNS server and match A, AAAA and MX
Open the file for a lot more validations.
Last updated