Re: confused: casting a variable to integer
- From: "Sean" <oreilly.sean@xxxxxxxxx>
- Date: 29 Nov 2005 09:56:46 -0800
See the differece if you use ===
<?
$name="henk";
echo "\$name=$name <br>";
echo "(int)\$name=".(int)$name."<br>";
if ($name === (int)$name){
echo "equal";
} else {
echo "Not equal";
}
?>
http://php.net/operators.comparison
.
- Follow-Ups:
- Re: confused: casting a variable to integer
- From: Justin Koivisto
- Re: confused: casting a variable to integer
- References:
- confused: casting a variable to integer
- From: Erwin Moller
- confused: casting a variable to integer
- Prev by Date: setting up a A/B split test with PHP
- Next by Date: Re: Sort array from a Query
- Previous by thread: Re: confused: casting a variable to integer
- Next by thread: Re: confused: casting a variable to integer
- Index(es):