Go Back   Dreamweaver Club Forums > Hand Coders Forum > PHP
Register FAQ Members List Search Today's Posts Mark Forums Read

Thread Tools Display Modes
Old 01-27-2012, 09:33 PM   #1
Join Date: Oct 2010
Posts: 340
Default understanding the while loop

Hi, im just trying to get a stronger understanding of while loop. I made a very simple script:

$a = 97;
$b = 23;

while ($a <= 1000) {
echo $a + $b;
echo "<br/>";
$a = $a + $b;

It behaves as expected until the final output figure which is 1017. Why? I have set it to be equal or less than 1000, can someone please tell me why the script is passing 1000?
tony09uk is offline   Reply With Quote

Thread Tools
Display Modes

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. The time now is 02:21 AM.

Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2018, vBulletin Solutions, Inc.
Copyright 2006 DreamweaverClub.com