How To Use For Loop In Php Using Array Tutorial Sample Script

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 with 2 Replies. Last Upated: Mon Apr 21, 2014
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
wallpaperama
not lets get more creative. how about if we can assign these values to an array?
http://wallpaperama.com/forums/how-to-use-for-loop-in-php-using-array-tutorial-sample-script-t5737.html
glaiza
hello good programming practice
Title: How To Use For Loop In Php Using Array Tutorial Sample Script [1085]
Tags: how to use for loop in php using array tutorial sample script