except for loop in PHP , there are other type of loop aviliable also ,
all type of loop is work same manner in PHP
while
$x=0;
while($x<=10){
echo $x;
$x++;
}
it will print 0 to 10
do-while
$x=0;
do {
echo $x." ";
$x++;
}while($x<=10);
it will print 0 to 10 with do.. while loop same as while loop
foreach
foreach loop is a different way of looping
foreach loop work always with an array in PHP
below is an example for foreach loop :
$loop=array(0,1,2,3,4,5,6,7,8,9,10);
foreach($loop as $value){
echo $value;
}
above is very simple example of the use of loop , but it can be complex use of for and other type of loop in PHP