note 38518 added to function.split

From: Date: Thu, 25 Dec 2003 19:23:20 +0000
Subject: note 38518 added to function.split
Groups: php.notes 
Request: Send a blank email to php-notes+get-62450@lists.php.net to get a copy of this message
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)) { ... } ?> ---- Manual Page -- http://www.php.net/manual/en/function.split.php Edit -- http://master.php.net/manage/user-notes.php?action=edit+38518 Delete -- http://master.php.net/manage/user-notes.php?action=delete+38518&report=yes Reject -- http://master.php.net/manage/user-notes.php?action=reject+38518&report=yes Search -- http://master.php.net/manage/user-notes.php

« previous php.notes (#62450) next »