While Loops in PHP
4
LOOPS WHILE LOOPS
-
Upload
suraj-motee -
Category
Education
-
view
39 -
download
0
Transcript of While Loops in PHP
![Page 1: While Loops in PHP](https://reader036.fdocuments.in/reader036/viewer/2022082607/55c3d618bb61ebec4b8b4707/html5/thumbnails/1.jpg)
LOOPSWHILE LOOPS
![Page 2: While Loops in PHP](https://reader036.fdocuments.in/reader036/viewer/2022082607/55c3d618bb61ebec4b8b4707/html5/thumbnails/2.jpg)
Loops
• PHP while loops execute a block of code while the specified condition is true.• while (condition is true) { code to be executed;}
![Page 3: While Loops in PHP](https://reader036.fdocuments.in/reader036/viewer/2022082607/55c3d618bb61ebec4b8b4707/html5/thumbnails/3.jpg)
Exercise:• Print 0-4 on the screen.
![Page 4: While Loops in PHP](https://reader036.fdocuments.in/reader036/viewer/2022082607/55c3d618bb61ebec4b8b4707/html5/thumbnails/4.jpg)
Exercise:
• The do...while loop will always execute the block of code once, it will then check the condition, and repeat the loop while the specified condition is true.