for (initialize counter; test counter; increment counter) {
  code to be executed;
}










for ($x=1; $x<=5; $x++) {
  echo $x;
}









while (condition)
{
    code to be executed;
}




$x = 1;

while($x <=5)
{
	echo $x;
	$x++;
}











foreach ($array as $value) {
  code to be executed;
}




$arr = array("A","B","C");

foreach($arr as $value)
{
 echo $value;
}











do
{
   code to be executed;
}while (condition);




$x = 1;

do
{
echo $x;
}while($x != 1);





Posted By  -  Karan Gupta
 
Posted On  -  Tuesday, September 02, 2014

Query/Feedback


Your Email Id  
 
Subject 
 
Query/FeedbackCharacters remaining 250