This is a form validation template in PHP:
- validation of username: remove all of the spaces with built in preg_replace() PHP function
- check some values with the built in in_array() PHP function
- email validation with filter_var()
- validation of date: between 1900 and the current year with filter_var() and the $options array argument