Home arrow PHP arrow Page 5 - PHP Statements and Beginning Loops

Here We Go Loop de Loop - PHP

We discussed statements briefly in our last article and even got a sneak peek of an IF-statement. Sure I mean, the image was blurry, and the moment it saw us it ran off into the forest. But we saw it. Honest. So in this article, we're going to take a much closer look at PHP statements and even start learning about loops.

TABLE OF CONTENTS:
  1. PHP Statements and Beginning Loops
  2. If
  3. Else
  4. Elseif
  5. Here We Go Loop de Loop
  6. For Loop
By: James Payne
Rating: starstarstarstarstar / 5
November 05, 2007

print this article
SEARCH DEV SHED

TOOLS YOU CAN USE

advertisement

You ever have one of those jobs where you do the same thing over and over all day, every day? Sure you have. Take the job of hamburger flipper. Before becoming the web's writer extraordinaire, I once worked at a burger restaurant. They sat me through orientation and gave me a giant book to study (which I never did; it was burger flipping, not rocket science). Then they told me my title and I was baffled: Top Bun Operator. Again: Top Bun Operator. No kidding. One guy "operated" the top bun and was responsible for its toppings, while a second guy was the Bottom Bun Operator. Apparently doing the whole bun was much too complicated.

One day, though , I became the Neo of the hamburger world. I was operating not only the top bun and the bottom bun, but the hot dog bun as well. All around me employees were betting their $5.25 an hour salaries and yelling "He's a madman!"

After that I quit, because let's face it: I had taken the job as far as it could go.

Can you imagine the poor dunce that gets reprimanded for not knowing how many pickle slices go on the top bun?

Anyway. Loops in PHP (and other programming languages) make the computer do repetitive tasks for you. I mean, that is what computing is all about. The are several types of loops, starting with the For Loop.



 
 
>>> More PHP Articles          >>> More By James Payne
 

blog comments powered by Disqus
escort Bursa Bursa escort Antalya eskort
   

PHP ARTICLES

- Hackers Compromise PHP Sites to Launch Attac...
- Red Hat, Zend Form OpenShift PaaS Alliance
- PHP IDE News
- BCD, Zend Extend PHP Partnership
- PHP FAQ Highlight
- PHP Creator Didn't Set Out to Create a Langu...
- PHP Trends Revealed in Zend Study
- PHP: Best Methods for Running Scheduled Jobs
- PHP Array Functions: array_change_key_case
- PHP array_combine Function
- PHP array_chunk Function
- PHP Closures as View Helpers: Lazy-Loading F...
- Using PHP Closures as View Helpers
- PHP File and Operating System Program Execut...
- PHP: Effects of Wrapping Code in Class Const...

Developer Shed Affiliates

 


Dev Shed Tutorial Topics: