- Forums
- PHP
- How To Use For Loop In Php Using Array Tutorial Sample Script
This Page Contains information about How To Use For Loop In Php Using Array Tutorial Sample Script By wallpaperama in category PHP with 2 Replies. [1085], Last Updated: Sat May 18, 2024
wallpaperama
Thu Feb 14, 2008
2 Comments
2760 Visits
its easy to use the for loop
lets say i want to display numbers 1 to 10 i would do this:
PHP CODE:
<?php
for($counter =1; $counter <= 10; $counter++) {
print("counter is $counter<br>n");
}
?>
this would be the output:
counter is 1
counter is 2
counter is 3
counter is 4
counter is 5
counter is 6
counter is 7
counter is 8
counter is 9
counter is 10
https://www.wallpaperama.com/forums/how-to-use-for-loop-in-php-using-array-tutorial-sample-script-t5737.html