How to Validate PHP Form?

HTML form used for PHP Form Validations, contains various input fields: required and optional text fields, radio buttons, and a submit button:

The validation rules for above form are as follows:

Field Type Validation Rules
First Name Required*. + Must contain only letters and whitespace
Last Name Optional.
Gender Required*. Must select at least one
Email Required*. + Must contain a valid email address (with @ and .)
Message Optional. TextArea – Paragraph text.
 

Close