Skip to content
+91-8802000175info@websjyoti.com
Join PHP Internship

PHP Training in Gurgaon

PHP Full Stack Developer Training

  • PHP Laravel
  • Digital Marketing
  • MERN Stack
  • Placements
  • Locations
    • Muzaffarpur Location
    • Php Training in Baksar
    • Php Training in Balia
    • PHP Training Gorakhpur
    • PHP Training in Patna
    • Training in Bangalore
    • PHP Training in Noida
    • PHP Training in Delhi
    • Training in Ghaziabad
  • CONTACT

The For Loop

  • Home
  • php-training-in-gurgaon
  • The For Loop
27 Mar 2017
hirdeshphp-training-in-gurgaonajax real time training gurgaon, ajax tutorial hirdesh, best php ajax institutes in gurgaon, for loop in php, php mysql institutes in gurgaon, php training and placement institutes in gurgaon, php training center in gurgaon haryana, php training course gurgaon, php training institute in gurgaon, php web development comapnies, real time training in gurgaon, top 10 php institutes gurgaon

PHP for loop can be used to traverse set of code for the specified number of times. For example if you want to repeat something ten or twenty times.

It should be used if number of iteration is known otherwise I recommend you to use while loop.

Syntax:

for (Initialization; Condition; Progressive)

{

//set of statements to be executed;

}

Parameters:

Initialization: Initialize the loop counter value

Condition: Check for condition. If it evaluates to TRUE, the loop continues. If FALSE then the loop ends.

Progressive: Increase / Decrease the loop counter value

Example:

for($var=1; $var<=20; $var=$var+1)

{

echo $var .” “;

}

Output:

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20

Example: to display 1st 20 natural numbers in drop-down list

<?php

echo “<select>”;

for($i=1; $i<=20; $i++)

{

echo ―”<option>”.$i. “</option>”;

}

echo “</select>”;

?>

Please note inside loop area we are using variable $i to display values in drop-down list as we use variable that changes slightly each time.

img_20160905_133318

Post navigation

PHP Superglobals
PHP -Building Blocks

Recent Posts

  • Webs Jyoti Conducted an Internship Program at St. Andrews College
  • Webs Jyoti Welcomes Interns from Symbiosis
  • Students Successfully Placed through Webs Jyoti in Various Profiles
  • PHP Training and Placement Experience at Webs Jyoti
  • 5 reason why digital marketing is important

Placement Corner

Excel Trainer
PHP trainer
Digital Marketing trainer
Advance Excel Trainer
SQL Trainer
Webs jyoti Placement
PHP traning Gurgaon
Webs Jyoti Placement
digital marketing
excel training Webs Jyoti
PHP Placement
SQL Training for Webs Jyoti
Webs Jyoti Placement
Trainer From Websjyoti
Digital marketing placement
PHP Training in Gurgaon
Excel training in gurgaon
MY SQL placement
Excel placement
Digital Marketing placement
PHP placement
advance excel placement
digital Marketing placement
SEO Placement
Java Script Placement
Advance excel placement
php placement
web development
Excel trainer
PHP placement
websjyoti Placement
php traning in gurgaon
Webs Jyoti placemnt
digital marketing placement
Webs Jyoti placement
PHP Traning in Gurgaaun
Advance excel placement
MY SQL placement
Web development
Excel Trainer
Webs Jyoti Placement
Webs Jyoti Placement
PHP placement
Digital Marketing placement
SEO experts
SMO placement
Webs Jyoti Placement
Webs Jyoti Placement
Advance Excel Placement
Webs Jyoti Placement
Webs Jyoti Placement
Graphic Designer
Advance Excel Placement
Webs Jyoti Placement
Excel Placement
Webs Jyoti Placement
Digital Marketing Placement
Webs Jyoti Placement
Excel Placement
Advance Excel Placement

Contact us

Webs Jyoti - M-24, Old DLF Colony, Sector 14, Gurgaon, Haryana 122001

Contact: +91-8802000175

Email: info@websjyoti.com

© 2024 Webs Jyoti, All right reserved. Proudly Powered By Webs Jyoti

Education Base by Acme Themes

WhatsApp us