Jump to content


Photo

valadate email address with eregi


  • Please log in to reply
1 reply to this topic

#1 redarrow

redarrow
  • Members
  • PipPipPip
  • Advanced Member
  • 7,308 posts
  • Locationlondon

Posted 05 April 2006 - 08:13 AM

Can you kindly tell me if the below code has any code speed diffrence in doing one example or the other cheers.


example 1
<?
echo"<br><br><br>";

$email="Anyemailaddress@anywere.com";

if(eregi("^.{1,25}@.{1,25}[./-].{1,3}$" , $email)) {

echo"Email address valid";

}else {

if(eregi("^.{1,25}.{1,25}[./-].{1,3}$" , $email)) {

echo"Email address not valid";
}
}

example 2

<?
echo"<br><br><br>";

$email="Anyemailaddress@anywere.com";

if(eregi("^.{1,25}@.{1,25}[./-].{1,3}$" , $email)) {

echo"Email address valid";

}else {

echo"Email address not valid";
}

?>

Wish i new all about php DAM i will have to learn
((EMAIL CODE THAT WORKS))
http://simpleforum.ath.cx/mail2.inc
((PAYPAL INTEGRATION THAT WORKS))
http://simpleforum.a...aypal1_info.inc

#2 Hooker

Hooker
  • Members
  • PipPipPip
  • Advanced Member
  • 193 posts
  • LocationWales, UK

Posted 06 April 2006 - 12:56 AM

if theres any difference at all it shouldnt be noticeable to be honest.




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users