Class Central is learner-supported. When you buy through links on our site, we may earn an affiliate commission.

Codecademy

Learn PHP: Conditionals and Logic

via Codecademy

Overview

Write programs that handle complex decision-making using the boolean data type, conditionals, and comparison and logical operators.
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!



### Take-Away Skills
By the end of this course, you will be able to:
* Control the program flow using `if`, `else if`, `else`, `switch`, and ternary syntax.
* Create decision-making programs using comparison and logical operators.

### Notes on Prerequisites
We recommend that you complete [Learn PHP: Functions](https://www.codecademy.com/learn/learn-php-functions) before completing this course.

Syllabus

  • PHP Conditionals: Control the program flow using `if`, `else if`, `else`, `switch`, and ternary syntax.
    • Lesson: Booleans and Comparison Operators
    • Quiz: PHP Conditionals
    • Project: Magic 8 Ball
    • Project: PHP Number Guessing
  • PHP Logic: Create decision-making programs using comparison and logical operators.
    • Lesson: Logical Operators and Compound Conditions
    • Quiz: Compound Conditions
    • Article: Common Mistakes with Conditionals
    • Project: Save the Farm!
    • Informational: Next Steps

Taught by

Kenny Lin

Reviews

4.6 rating at Codecademy based on 97 ratings

Start your review of Learn PHP: Conditionals and Logic

Never Stop Learning.

Get personalized course recommendations, track subjects and courses with reminders, and more.

Someone learning on their laptop while sitting on the floor.