Matthew Penn's Blog! Email him at matt@penncomm.com
Recent Articles
PennComm Provides Online Volunteer Registration Solution for the 2012 Buckeye Wheelchair Games
New Client - BirdFeederDiscovery.com
Gold Crest Distributing Presentation
JabberText.com Provides Group Text Messaging For Organizations Nationwide
Penn Communications Redesigns & Develops Website for Gold Crest Distributing
Job Complete - Work Request System for Mexico Public Schools
For example, I recently had to code a project that looked at the variable "mQ1." If that variable had a value of "0" (zero), then I had to subtract 1 from the variable "mDIV"
So, my PHP code looked like this:
if ($mQ1 == 0) { $mDIV = $mDIV - 1; }
I'll break this down real quick.
if ($mQ1 == 0)
This is our "look" -- we are taking a look at the variable $mQ1. If it does equal zero, then the rest of our statement (in the brackets) will be performed. If false, then the statements in the bracket will be ignored.
{ $mDIV = $mDIV - 1; }
This is the statement that takes place is the "If" statement is TRUE. I am simply subtracting 1 from the $mDIV variable. And That's it!
Posted: 2007-03-31