Re: problem with intval and !=
| From: | Marek Kilimajer | Date: | Thu, 23 Oct 2003 17:01:51 +0000 |
| Subject: | Re: problem with intval and != | ||
| References: | 1 2 3 4 5 6 7 8 9 10 11 12 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-167320@lists.php.net to get a copy of this message | ||
This echoes out "Bad" on my LAMP server as it should, but "Good" on Cesar's windows server:
$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.