note 93067 added to filter.examples.validation

From: Date: Fri, 21 Aug 2009 14:02:23 +0000
Subject: note 93067 added to filter.examples.validation
Groups: php.notes 
Request: Send a blank email to php-notes+get-159751@lists.php.net to get a copy of this message
This filter may validate email addresses that are not always useful. In the example below "bar@example" returns as valid despite the lack of a top level domain and "baz@example.E1uA-wyE0" returns as valid despite having a random string for a tld. <?php $email_a = 'foo@example.com'; $email_b = 'bar@example'; $email_c = 'baz@example.E1uA-wyE0'; if ( filter_var($email_a, FILTER_VALIDATE_EMAIL) ) { echo $email_a . ' is considered a valid email address.<br />'; } if ( filter_var($email_b, FILTER_VALIDATE_EMAIL) ) { echo $email_b . ' is considered a valid email address.<br />'; } if ( filter_var($email_c, FILTER_VALIDATE_EMAIL) ) { echo $email_c . ' is considered a valid email address.<br />'; } ?> ---- Server IP: 64.71.164.2 Probable Submitter: 24.0.226.3 ---- Manual Page -- http://www.php.net/manual/en/filter.examples.validation.php Edit -- https://master.php.net/note/edit/93067 Del: integrated -- https://master.php.net/note/delete/93067/integrated Del: useless -- https://master.php.net/note/delete/93067/useless Del: bad code -- https://master.php.net/note/delete/93067/bad+code Del: spam -- https://master.php.net/note/delete/93067/spam Del: non-english -- https://master.php.net/note/delete/93067/non-english Del: in docs -- https://master.php.net/note/delete/93067/in+docs Del: other reasons-- https://master.php.net/note/delete/93067 Reject -- https://master.php.net/note/reject/93067 Search -- https://master.php.net/manage/user-notes.php

« previous php.notes (#159751) next »