Being able to evaluate statements as true or false is crucial in the PHP scripting language. In this lesson, learn to use PHP conditionals to run code!
Learn to use PHP to evaluate complex conditional statements. Mark Lassoff shows how to use if, else, and elseif statements to control a PHP script.
If you have a lot of outcomes in a conditional statement, a switch statement may be easier to use than an “if” conditional. Learn to use "switch, case, break."
There are many ways to write conditional statements in PHP. Now that you’ve learned the if statement and switch statement, learn how to use a ternary operator.
PHP loops allow a computer programmer to repeat an operation many times in a row. Learn to code while loops and do while loops in the programming language.
- Recommended Recommended
- History & In Progress History
- Browse Library
- Most Popular Library
Get Personalized Recommendations
Let us help you figure out what to learn! By taking a short interview you’ll be able to specify your learning interests and goals, so we can recommend the perfect courses and lessons to try next.Start Interview
You don't have any lessons in your history.
Just find something that looks interesting and start learning!