Heads up! To view this whole video, sign in with your Courses account or enroll in your free 7-day trial. Sign In Enroll

- 2x 2x
- 1.75x 1.75x
- 1.5x 1.5x
- 1.25x 1.25x
- 1.1x 1.1x
- 1x 1x
- 0.75x 0.75x
- 0.5x 0.5x
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.
Example
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.
Documentation
Learn about additional Comparison Operators
Related Discussions
Have questions about this video? Start a discussion with the community and Treehouse staff.
Sign up-
Andrey Volsky
1,290 PointsWhy does my result ends up with bool(false) every time?
Posted by Andrey VolskyAndrey Volsky
1,290 Points2 Answers
-
Mahfuzur Rahman
3,204 Points2 Answers
-
TJ Smith
2,240 Points1 Answer
-
nathanielcusano
9,808 Points2 Answers
-
Kris Muir
2,355 Points3 Answers
View all discussions for this video
Related Discussions
Have questions about this video? Start a discussion with the community and Treehouse staff.
Sign up
You need to sign up for Treehouse in order to download course files.
Sign upYou need to sign up for Treehouse in order to set up Workspace
Sign up