Doc #70054 [Opn->Nab]: Mistype error
| From: | cmb@php.net | Date: | Sun, 12 Jul 2015 17:23:03 +0000 |
| Subject: | Doc #70054 [Opn->Nab]: Mistype error | ||
| References: | 1 | Groups: | php.doc.bugs |
| Request: | Send a blank email to doc-bugs+get-12512@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=70054&edit=1
ID: 70054
Updated by: cmb@php.net
Reported by: support at cattechsol dot com
Summary: Mistype error
-Status: Open
+Status: Not a bug
Type: Documentation Problem
Package: Documentation problem
PHP Version: Irrelevant
-Assigned To:
+Assigned To: cmb
Block user comment: N
Private report: N
New Comment:
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.
Previous Comments:
------------------------------------------------------------------------
[2015-07-12 15:53:17] 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...
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=70054&edit=1