hello,
i use php 4.3.3 under windows,
the following code seems doesn't give correct output when array contains more than one key:
$array = explode("\n", $emails);
$nummails = count($array);
foreach($array as $key=>$email){
if(eregi("[a-z0-9]+([_\.-][a-z0-9]+)@([a-z0-9]+([.-][a-z0-9]+))+\.[a-z]{2,4}$", $email, $regs))
{
print $email." - Valid<br>";
} else {
print "<font color='FF0000'>".$email." - Invalid</font><br>";
}
}
is this a bug? 😕
if not pls. help anyone to solve this problem,
tnx
p.s.
data posted from the folowing form:
<form method="POST" action="maillist.php" name="form">
<p align="center"><textarea rows="15" name="emails" cols="40"></textarea><br>
<br>
<br>
<input type="submit" value="Submit" name="submit"><input type="reset" value="Reset" name="B2"></p>
</form>