This forum is now read-only. Please use our new forums! Go to forums
Notes for lesson 1.2: Making Comparisons
Below is a snippet of the code I used that allowed me to advance to the next lesson.
<p>
<?php
(100 < 200);
(200 > 100);
(100 == 100);
199 <= 200;
201 >= 200;
100 != 200;
?>
</p>
- Using the parenthesis does not appear to affect the code one way or another, so I’m not sure which is actually the correct method. As an experiment, I was able to save and submit the code above, as is, and move on to the next lesson.
- The instructions ask to make only one comparison, however I have found that you need at least two comparisons do advance to the next lesson.
Answer 520e9072548c3507d80073b0
Answer 5226b85bf10c609c24001624
4 votes
Any comparison works, be it one or many, though you must not use echo
or semicolon
If you write echo you will see 1 (true) or 0 (false) in the console, but the exercise will check it internally.
Something as simple as this below will work:
<?php
8 >= 8
?>
I did some trial and error though, as at first it didn’t seem much obvious for me.
Answer 51e4dbbf9c4e9db1ff0016af
1 comments
Robert Bennett over 10 years
Thanks a lot, this was driving me crazy.
Popular free courses
- Free Course
Learn SQL
In this SQL course, you'll learn how to manage large datasets and analyze real data using the standard data management language.Beginner friendly,4 LessonsLanguage Fluency - Free Course
Learn JavaScript
Learn how to use JavaScript — a powerful and flexible programming language for adding website interactivity.Beginner friendly,11 LessonsLanguage Fluency - Free Course
Learn HTML
Start at the beginning by learning HTML basics — an important foundation for building and editing web pages.Beginner friendly,6 LessonsLanguage Fluency
1 comments
Thanks that helped me, I wasn’t able to pass this lesson till I used your code. Thanks