note 38518 deleted from function.split by nlopess

From: Date: Fri, 26 Dec 2003 09:49:42 +0000
Subject: note 38518 deleted from function.split by nlopess
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-62491@lists.php.net to get a copy of this message
Note Submitter: Larry Richter ---- Here's an obvious code snippet (posted only because it seems from other posting as though some people may find it useful). To break up the contents of a form element prompting the user to enter a number of email addresses (in this case, $_POST["email_addresses"]), verify each address and parse it, use: <?php foreach(split("[\n\r ]", $_POST["email_addresses"]) as $email_address) if(eregi("^[\'+\\./0-9A-Z^_\`a-z{|}~\-]+@ [a-zA-Z0-9_\-]+(\.[a-zA-Z0-9_\-]+){1,3}$", $email_address)) { ... } ?>

« previous php.notes (#62491) next »