Re: problem with intval and !=

From: Date: Thu, 23 Oct 2003 15:09:52 +0000
Subject: Re: problem with intval and !=
References: 1 2 3  Groups: php.general 
Request: Send a blank email to php-general+get-167290@lists.php.net to get a copy of this message
* Thus wrote Cesar Cordovez (phpguru@cesamo.com): > Curt: > > My fault! You are right, but thats not what I want. $value comes from a > form filled by a user. I want $value to be an integer. Not a float. > So if the user types "12.3" the system has to send an error msg. Yeah, after reading merek's response I realized I missed what exactly your problem is. > > Therefore the procedure. > > By-the-way, Im using PHP 4.3.3 (on windows XP profesional. Don't say a > thing!!! I rather work on my mac!) =) Thats odd, I come up with a 'Bad' echo also. The only thing I can think of is there is some sort of implicit casting happening to the $value within the comparison. But it does seem very strange that XP would cast but *nix doesn't In that case test the condition reversed: if ($value != $number) I'm at a loss as to why it doesn't work on your system. Curt -- "My PHP key is worn out" PHP List stats since 1997: http://zirzow.dyndns.org/html/mlists/

« previous php.general (#167290) next »