Jump to content

A basic question on php..


Recommended Posts

If you know what == is, === is similar, but it also makes sure that the type of the two variables is the same:

$a = 1;$b = "1";if($a == $B) { // This statement evaluates to true because $a and $b are both 1    echo "A and B are both 1";}if($a === $B) {  // This statement evaluates to false because $a is a number and $b is a string    echo "A and B are both 1 and are both the same type";}
Link to comment
Share on other sites

  • 2 weeks later...

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Create New...