Follow Star

Control Structures => do-while


1
2
3
do {
    code
} while (condition  T );
1
2
3
4
5
<?php
do {
  // code...
} while ();
 ?>

1. do while

1
2
3
4
5
6
7
8
9
10
11
<?php
$a = 0;
$b = "10 * 10 =";
$c = 10;
$g = 10;
$k = $c * $g;  
do {
echo  "<p> $b $k <p>";

} while ($a = 0);
 ?>

while wie do while


1
2
3
4
5
6
7
8
9
10
11
12
13
<?php
$a = 5;
while ($a <= 8){
echo "while es ist $a .<br>";
  $a++;
}

// Outbut : =  while es ist 5 .
// while es ist 6 .
// while es ist 7 .
// while es ist 8 .

?>

while wie do while


1
2
3
4
5
6
7
8
<?php
$a = 5;
do {
echo "while es ist $a .<br>";
  $a++;
}  
while ($a <= 8);
?>

while + HTML


1
2
3
4
5
 <?php
 $a = 5;
 while ($a <= 8): ?>
 <h1> while es ist <?php  echo $a; "<br>"; $a++; ?> </h1>
<?php endwhile; ?>
Control Structures      
if      
else      
elseif/else if      
Alternative syntax for control structures      
while      
do-while      
for      
foreach      
break      
continue      
switch      
declare      
return      
require      
include      
require_once      
include_once      
goto      

Tags:

Categories:

Updated:

Comments