Comparing Values4:53 with Alena Holligan
Comparison operators allow us to compare values and yield the result. In this video we'll be looking at equal and identical comparisons. Equal compares ONLY the values while identical compares the values and type. We'll also consider type juggling in PHP.
To assign the result of a comparison to another value, you would use:
$a = 10; $b = "10"; $c = ($a == $b);
It is a good idea to use parentheses to be clear on evaluation.
Learn about additional Comparison Operators
You need to sign up for Treehouse in order to download course files.Sign up