PHP Day 6: Booleans, More Operators, and Conditional Statements
This five-minute video covers the basics of boolean values, comparison operators, logical operators, and conditional statements (using if, else, elseif, and switch).
Links for PHP Day 6: Booleans, More Operators, and Conditional Statements
Booleans:
- PHP: Booleans
- Note: it’s been brought to my attention (thanks to a certain database-programming boyfriend) that I really skipped over explaining boolean values. I was a little too eager to get to the conditional statements, I guess.
The link above should help. If something isn’t clear, though, just let me know.
Operators:
Conditional statements:
Since this stuff was pretty simple, I found that I really didn’t need any reference sites other than the PHP manual.



February 8th, 2007
Question: I was watching your thing about cases, what happens if you want something like greater than 5 as a case, instead of just 5?
February 8th, 2007
Good question! I didn’t want to spend too much time on it now, so I just skimmed over how it basically works.
But I looked it up on the PHP manual, and I found the answer in a comment on the page for Switch. So, switch works by matching one value against all the values given after each case. And “
$x > 5” has a value of true or false, right? So to match the values against each other, you’d have to put “true” afterswitch:It makes more sense to me to just use
ifandelseif, but I guess this does have its uses.February 9th, 2007
Awesome!