Answers for "php do while loop"

PHP
10

for loop php

<?php
	$fruits = ["apple", "banana", "orange"];
	for($i=0;$i<count($fruits);$i++){
    echo "Index of ".$i."= ".$fruits[$i]."<br>";
    }
  ?>
Posted by: Guest on December-28-2019
6

for loop in php

/*
For loop in php
*/

<?php
for ($i = 0; $i < 10; $i++) {
     echo $i."<br>";
} 
?>
Posted by: Guest on May-06-2020
7

while loop php

<?php
	$a = 0;
	while($a<=5){
    	echo $a."<br>";
      $a++;
    }
  ?>
Posted by: Guest on December-28-2019
7

do while php

<?php
$i = 0;
do {
    echo $i;
} while ($i > 0);
?>
Posted by: Guest on April-01-2020
4

php for loop

for($i = 0; $i <=10; $i++){
	echo "The index is $i";
}
Posted by: Guest on July-23-2020
2

while true php

while(true) {
 // Infinite Loop
}
Posted by: Guest on August-10-2020

Browse Popular Code Answers by Language