PHP - How to start my count from 5000 [closed]
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++;
}
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.
Is that real question? Try:
$i = 5000;
while($i <= 19000){
$i++;
}
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
simply initialise $i with 5000
精彩评论