tags:

views:

97

answers:

5

How can i start the count from 5000 and count from there in my following code.

here is my code.

$i=1;
while($i<=19000){
    $i++;
}
+1  A: 

Is that real question? Try:

$i = 5000;
while($i <= 19000){
    $i++;
}
Sarfraz
+5  A: 

You could initialize $i to the right value, before beginning looping :

$i=5000;
while($i<=19000){
    $i++;
}


And/or you could rewrite your code to use a for loop :

for ($i=5000 ; $i<=19000 ; $i++) {
    // use $i
}

In this kind of situations, using a for loop, instead of while, might make your code easier to understand.

Pascal MARTIN
A: 

Learning basics of programming seems needed: Have a look at the Introduction to Programming ... Go through the exercises there.

If you are interested in learning how to program using PHP have a look at Introduction to programming using PHP

Elf King
He needs exactly !
Osman Üngür
A: 

you can write with "for" loop

Osman Üngür
A: 

simply initialise $i with 5000

Waqar