What PHP function can be used to validate an email in a PHP form?
- filter_var()
- strlen()
- strtoupper()
- count()
The PHP function that can be used to validate an email in a PHP form is filter_var(). Specifically, you can use the FILTER_VALIDATE_EMAIL filter to validate the email input against the predefined email format. filter_var() is a versatile function that allows you to validate various types of data, including emails, URLs, and more. Learn more: https://www.php.net/manual/en/function.filter-var.php
Loading...
Related Quiz
- Which of the following are ways to use callback functions in PHP?
- You have a multidimensional array in your PHP script and you're encountering issues with accessing or manipulating the elements. How would you debug this?
- Comments in PHP code are ignored by the ______.
- What is the difference between the 'BITWISE AND' operator and the 'LOGICAL AND' operator?
- The break statement in PHP is used to ______ the execution of the current loop and move to the next iteration.