|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2015-07-12 15:53 UTC] support at cattechsol dot com
Description: ------------ --- From manual page: http://www.php.net/filter.examples.validation --- In PHP Filter Email Validation there is mistype error in the first example. <?php $email_a = 'joe@example.com'; $email_b = 'bogus'; if (filter_var($email_a, FILTER_VALIDATE_EMAIL)) { echo "This ($email_a) email address is considered valid."; } if (filter_var($email_b, FILTER_VALIDATE_EMAIL)) { echo "This ($email_b) email address is considered valid."; } ?> Both the bogus and valid are given valid emails... PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sat Oct 25 02:00:01 2025 UTC |
The example is correct. For the second address ("bogus") filter_var() returns false, and so the echo statement is not executed. The output can be seen below the example.