Re: problem with intval and !=
| From: | Robert Cummings | Date: | Thu, 23 Oct 2003 17:15:12 +0000 |
| Subject: | Re: problem with intval and != | ||
| References: | 1 2 3 4 5 6 7 8 9 10 11 12 13 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-167322@lists.php.net to get a copy of this message | ||
On Thu, 2003-10-23 at 13:01, Marek Kilimajer wrote:
> This echoes out "Bad" on my LAMP server as it should, but "Good" on
> Cesar's windows server:
Aaaah how true. I wasn't following this much earlier so I don't know if
he is using the most up to date version, in which case it may already be
fixed.
Cheers,
Rob.
>
> $value = "12.3";
> $number = intval($value);
>
> echo "Number: $number, Value: $value<br>";
> // echoes: Number: 12, Value: 12.3
>
> if ($number != $value) {
> echo "Bad";
> } else {
> echo "Good"; // echoes Good!!!!!!
> }
>
>
>
> Robert Cummings wrote:
>
> > On Thu, 2003-10-23 at 12:43, Marek Kilimajer wrote:
> >
> >>These are all workarounds around the real problem. If php gets it wrong
> >>fix php.
> >
> >
> > Could you explain how PHP has it "wrong"?
> >
> > Rob.
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
--
.------------------------------------------------------------.
| InterJinn Application Framework - http://www.interjinn.com
|
:------------------------------------------------------------:
| An application and templating framework for PHP. Boasting |
| a powerful, scalable system for accessing system services |
| such as forms, properties, sessions, and caches. InterJinn |
| also provides an extremely flexible architecture for |
| creating re-usable components quickly and easily. |
`------------------------------------------------------------'