Wallpapers Forums Login

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

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
glaiza Fri Feb 17, 2012
hello good programming practice
hostman Thu Feb 14, 2008
not lets get more creative. how about if we can assign these values to an array?

Related Content

Information

Share

wallpaperama | Wallpapers | Forums | Terms Of Service

copyright © 2013 wallpaperama - All Rights Reserved - Last Updated Mon May 06, 2013 (-8 GMT)
Powered by: Webune Forums V5