Learn PHP: Conditionals and Logic
Why Learn PHP: Conditionals and Logic?
Continue your PHP learning journey! Writing programs that can handle complex decision-making sets you up to make powerful, interesting programs. This course will give you the tools you need to make flexible and dynamic programs!
By the end of this course, you will be able to:
- Control the program flow using
switch, and ternary syntax.
- Create decision-making programs using comparison and logical operators.
Notes on Prerequisites
We recommend that you complete Learn PHP: Functions before completing this course.
Codecademy courses have been taken by employees at
Magic 8 Ball
In this lesson, you've learned about conditionals—a fundamental yet powerful part of programming. Conditionals are so powerful, in fact, that they can be used to predict the future. In this project, you'll be creating a function that can answer any "yes" or "no" question.
PHP Number Guessing
In this project, you'll create a number guessing game. Your program will generate a random number between 1 and 10. You'll run the game 10 times and tell the user some information about their guessing abilities.
Save the Farm!
_Hello there. It's been a harrowing few weeks. First your toenail issue, and now Great-Aunt Natasha's emu farm is in danger of being repossessed! So here you are---after a brief stopover at the Mayo Clinic---in Uncle Boris's remote cabin in the heart of the Terror Woods. Family legend holds that a golden statue of immense value is hidden somewhere within these walls..._ Welcome to the world of interactive fiction. In this project, you'll be building a text adventure game called **Save the Farm**!
— Madelyn, Pinterest
I know from first-hand experience that you can go in knowing zero, nothing, and just get a grasp on everything as you go and start building right away.
Write programs that handle complex decision-making using the boolean data type, conditionals, and comparison and logical operators.
DetailsEarn a certificate of completion
5 hours to complete in total