Posted By

phpdev on 09/14/13


Tagged

regex email mail check security college school university edu


Versions (?)

Who likes this?

1 person have marked this snippet as a favorite

Priestd09


Check University Email (.edu)


 / Published in: PHP
 

Example of use:

if (!isUniversityEmail('[email protected]'))
     exit('You must have a valid and .edu email address to register for an account.');
  1. /**
  2.  * @title Check if it is a valid and university email address.
  3.  *
  4.  * @author Pierre-Henry Soria <[email protected]>
  5.  * @copyright (c) 2013, Pierre-Henry Soria. All Rights Reserved.
  6.  * @param string $sEmail
  7.  * @return boolean
  8.  */
  9. function isUniversityEmail($sEmail)
  10. {
  11. return preg_match('/^[a-z0-9_\-]+(\.[_a-z0-9\-]+)*@([_a-z0-9\-]+\.)+edu$/i', $sEmail);
  12. }

Report this snippet  

Comments

RSS Icon Subscribe to comments
Posted By: DavidBryant on March 12, 2018

Well, I find this to be a complicated way for making email account ! I have 800 email record to make in same area: I should make a Xml documents with header next incorporate one by one the name and utilize the perl content for execute ! (for example I don't comprehend what is "domain_id", or what secret word use in header) is too long ! It's impractical to have a simple route for much creation ? for instance, script which has a record with all names and creates emails accounts automatically ?

Academic help!buy essays services online.

Posted By: Jonathan87 on April 5, 2018

All things considered, I observe this to be an entangled path for influencing email to account! I have 800 email record to make in the same zone: I should make an XML archive with header next consolidate one by one the name and use the Perl content for executing! (for instance, I don't appreciate what is "domain_id", or what mystery word use in header) is too long! Is it unrealistic to have a straight course for much creation? Get help from our essay writers uk

You need to login to post a comment.