Problem with a while loop

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



I am having a problem with a while loop
if I put in a number with 0's in front of it it converts the number
two the first whole number. such as 00001 would be 1 02200 would be
2200. Then it starts the count down starting with that number.

How can I make it not remove the 0's in front of the number these are
needed to search a certain database .

The following script would look like this when run
00001
2
3
4
I needed it to look like this
00001
00002
00003

<?php
$startnumber="00001";
$stopnumber="02200";

$i = $startnumber;
echo $i;

while ($i <= $stopnumber):
echo "<br>" ;
echo $i;

++$i;
endwhile;
?> 

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux