What can you do without operators? Not much, if you're trying to do without them in a programming language, and PHP is no exception. On Monday, we barely had time to show you a long list of the operators in PHP. Today, we're going to show you what they do.
Logical operators are used to help test one or more criteria. The && operator says: if this and this are true, then do this. The || operator says: if this criteria OR that criteria is true, then do this. And finally the ! operator checks to see if a value is NOT true.
Oops I Did It Again
One thing I neglected to cover in the previous article was the use of quotes when using the echo function. This caused me to be beaten with many whips and locked in the basement with only episodes of Ugly Betty to keep me company. I know. I still haven't recovered.
When mixing HTML and PHP together be sure to follow these rules:
Do not use quotes inside of a string
Use the backslash to escape your quotes within a string