-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathwhiledowhileloop.php
More file actions
36 lines (31 loc) · 841 Bytes
/
whiledowhileloop.php
File metadata and controls
36 lines (31 loc) · 841 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
<?php
$title = "While/Do Whille Loop";
include 'includes/header.php';
?>
<h1><center>While Loop</center></h1>
<?php
$marks = 0;
// Infinite Loop
// while($marks < 10){
// echo '<p> I AM LESS THAN 10!</p>';
// }
// Pre-Condition Loop
while($marks < 10){
echo '<p> I AM LESS THAN 10!</p>';
$marks ++;
}
echo 'EXIT LOOP!';
echo '<hr>';
?>
<h1><center>Do-While Loop</center></h1>
<?php
// Post-Conditions Loop
$marks = 0;
do{
echo '<p> I AM DO WHILE LOOP</p>';
$marks++;
}while($marks < 10);
echo 'EXIT LOOP!';
echo '<hr>';
?>
<?php require 'includes/footer.php' ?>