Click to See Complete Forum and Search --> : what is a good way to search an array?


Sexay_Hamster
11-24-2003, 08:16 PM
im using this to search an array to varify emails...

i used

$emailvarify = explode("@", $email");

then i want to search $emailvarify['1'] to make sure it has a . so i know it has a .com or .net after it..

anyone know how?

pyro
11-24-2003, 08:26 PM
You would benefit greatly from using a regular expression to check the email, and Jeff Mott has been kind enough to give us one that is true to the RFC822.

http://forums.webdeveloper.com/showthread.php?s=&threadid=9604#post49397

Sexay_Hamster
11-24-2003, 08:43 PM
i like to write my own scripts though so i learn :)

thanx anyways tho :)

pyro
11-24-2003, 10:20 PM
But there's nothing wrong with looking at one (very good) way to do it... :)