php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Doc Bug #70054 Mistype error
Submitted: 2015-07-12 15:53 UTC Modified: 2015-07-12 17:23 UTC
From: support at cattechsol dot com Assigned: cmb (profile)
Status: Not a bug Package: Documentation problem
PHP Version: Irrelevant OS:
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: support at cattechsol dot com
New email:
PHP Version: OS:

 

 [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...


Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2015-07-12 17:23 UTC] cmb@php.net
-Status: Open +Status: Not a bug -Assigned To: +Assigned To: cmb
 [2015-07-12 17:23 UTC] cmb@php.net
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.
 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Tue Jul 01 21:01:35 2025 UTC