if statement

A

Anonymous

Guest
I understand doing something like this
Code:
if ($one == $two) three();
but what I dont understand is
Code:
if ($one === $two) three();

What is the third equal sign do? I tried searching in php.net but didn't find it.
 
=== = exactly the same (including type)

1 == 01
1 !=== 01

1 == '1'
1 !=== '1'

the typecasted === is rarely used though.
 
If you want to understand how it's work to you need to know what === it's called like equal if some variables for example $a and $b but $a is string and $b is not yore have a fail :^(
 
Back
Top