$emailAddrs = array("namepart@domain.com","@onfirstpos","missing","",'');
Array
(
[0] => namepart@domain.com
[1] => @onfirstpos
[2] => missing
[3] =>
[4] =>
)
With this code :
foreach ($emailAddrs as $emailAddr ) {
if (strpos($emailAddr,'@') > 0) {
$name = substr($emailAddr,0,strpos($emailAddr,'@'));
} else {
$name = "Invalid";
}
echo "'$emailAddr' ... '$name'
";
} // foreach
for European Experts Exchange and Edaìn Works back to list of test scripts
Last update 2009-10-30 09:19:08
| Add This Article To: | |||
| |
|
|
|
| |
|
|
|