Re: [PHP] need help on ereg statement

2002-05-04 Thread Trond Arve Nordheim
On Sat, May 04, 2002 at 02:42:34PM +0200, Andy wrote: > if (ereg("^[A-Za-z0-9]",$new_passw)) if (!preg_match("/^[a-zA-Z0-9]*$/", $new_passw)) { echo "invalid"; } preg-power! :) -- Trond Arve Nordheim - "This message is ROT13-encrypted twice for extra security." -- PHP General Mailing Lis

[PHP] need help on ereg statement

2002-05-04 Thread Andy
Hi there, I am trying to validate a password. Only characters in the alphabet and numbers should be allowed. Somehow my statement does not work at all :-( if (ereg("^[A-Za-z0-9]",$new_passw)) echo 'invalid'; Can anybody help on that? Thanx in advance, Andy -- PHP General Mailing List