Hi.. This is a stupid question but why not give it a try?
is[php]<?php
if($var1 == $var2){}
?>[/php]
the same as[php]<?php
if($var2 == $var1){}
?>[/php]
?
also, what is recommended to use, == or === ?

Tino wrote:Well, it is, but if you want to see if $var1 is equal to something, it doesn't make sense to make it the right-hand operand. It's not semantically correct.
As far as I know, it doesn't matter if you use == or ===. I guess === is a little bit more secure or something, otherwise I don't really see how it could be significantly superior.
=== also checks the data type for example

Tino wrote:=== also checks the data type for example
Yes, I knew that. I just didn't know if there was any particular reason for its existence, so just made a random guess that it had something to do with security :3
Users browsing this forum: No registered users and 1 guest