[_] actually not regex, php help needed...
Craig Francis
craig at craigfrancis.co.uk
Thu Mar 20 15:33:22 GMT 2008
Looks like the code is being run twice?
I suspect that its something outside what you have posted here.
On 20 Mar 2008, at 15:11, s'unya wrote:
> I did more testing and discovered that my regex actually outputs
> true, but
> an if statement appears to be both true and false...
>
> CODE:
> $ftest=(ereg("^[^@]{1,64}@[^@]{1,255}$", $email))?1:0;// to force 0
> when
> false
> if($ftest <1){
> //return false;
> print("no email: ".$email." matches? ".$ftest);
> }else{
> print("yes email: ".$email." matches? ".$ftest);
> }
>
> OUTPUT:
> yes email: sunya.dickman at gmail.com matches? 1
> no email: matches? 0
>
> Can any one tell me:
> 1) why the email is lost
> 2) why the condition is tested twice anyway?
> --
> o
> o o
> O O O
> o 0 O s´unya O 0 o
> www.the-resort.com
> --
> underscore_ list info/archive -> http://www.under-score.org.uk/mailman/listinfo/underscore