<?php $x=27; $rs=0.2; for ($i=1;$i<=15;$i++) { $x-=$rs; echo "$x<br>"; if($x===25.2) { echo "ok"; } } ?> PHP: if($x===25.2) { echo "ok"; } unable to determine 25.2 what's error with it?
I am confused,for i am learning the basic php, just start with the phpinfo(); glad to see you discuss the php, i am gald to learn it here!
It's Possible buddy: I downloaded a code snippet from the internet, a long time ago. The code contained === in a if() decision, I checked the code thorowly, because it was giving error on execution. I found that the coder (who posted the code on some site), added an extra =, may be it was a typo, or he was not intended to reveal his fully-working code.
You use === and == for different reasons. $t === "1" would mean that the variable $t was stored as "1" -- an exact match $t == "1" would mean that whatever is stored in $t is equivalent to 1. $t = 2-1; will return a true with ==, but a false with ===.