Go Back   CodingForums.com > :: Server side development > PHP

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 11-19-2007, 10:08 PM   PM User | #1
Tri Edge
New to the CF scene

 
Join Date: Nov 2007
Location: Harriston, Ontario
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Tri Edge is an unknown quantity at this point
While loops

I have to put a while loop in an assignment and I was wondering if someone could explain what it does and possibly give me an example then I can at least attempt it on my own, but an explination will be just fine thanks!
Tri Edge is offline   Reply With Quote
Old 11-19-2007, 10:35 PM   PM User | #2
aedrin
Senior Coder

 
Join Date: Jan 2007
Posts: 1,648
Thanks: 1
Thanked 58 Times in 54 Posts
aedrin will become famous soon enough
http://www.google.com/search?q=php+while+loop
aedrin is offline   Reply With Quote
Old 11-19-2007, 10:57 PM   PM User | #3
Majoracle
Regular Coder

 
Join Date: Nov 2006
Posts: 246
Thanks: 13
Thanked 26 Times in 24 Posts
Majoracle is an unknown quantity at this point
http://us3.php.net/manual/en/control...ures.while.php

Just a very basic example:

PHP Code:
$i 1;
while (
$i <= 10) {
    echo 
"This is line $i<br>"// print line number
    
$i++; // add 1 to $i

Prints:

This is line 1
This is line 2
This is line 3
This is line 4
This is line 5
This is line 6
This is line 7
This is line 8
This is line 9
This is line 10

Last edited by Majoracle; 11-19-2007 at 11:05 PM..
Majoracle is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 05:11 PM.


Advertisement
Log in to turn off these ads.