Heads up! To view this whole video, sign in with your Courses account or enroll in your free 7-day trial. Sign In Enroll
Start a free Courses trial
to watch this video
Let's put together the skills you've learned in this course to add functionality to our todo app. We'll start by displaying either complete, incomplete, or all tasks. In doing so, we'll take a closer look at how some of the comparisons work in conditional statements and how to use a secondary array to access array elements.
Boolean Comparisons
In PHP, when a value comparison is made with one of the element being a boolean value, each element is evaluated as a boolean.
Comparing EQUAL VALUES (empty string equals false, but any other string equals true) ('all' == 'all') equals true (after type juggling) (false == 'all') equals false (after type juggling) (true == 'all') equals true (after type juggling) (false == '') equals true (after type juggling) (true == '') equals false (after type juggling)
Comparing IDENTICAL Values and of the same type. ('all' === 'all') equals true (false === 'all') equals false (true === 'all') equals false (false === '') equals false (true === '') equals false
Related Discussions
Have questions about this video? Start a discussion with the community and Treehouse staff.
Sign upRelated 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