Posted by Erwin Moller on 11/29/05 18:55
Hi group,
Maybe I should stop working because this seems soo basic.
I almost feel ashamed to ask, but here we go.
:-/
Consider the following script:
<?
$name="henk";
echo "\$name=$name <br>";
echo "(int)\$name=".(int)$name."<br>";
if ($name == (int)$name){
echo "equal";
} else {
echo "Not equal";
}
?>
produces:
-----------------
$name=henk
(int)$name=0
equal
------------------
What am I missing here?
Is PHP casting the string "henk" to 0 somehow?
Regards,
Erwin Moller
Navigation:
[Reply to this message]
|