Asked 7 years ago
31 Mar 2017
Views 1158
yogi

yogi posted

how to use loop without using for or foreach or while in PHP

to iterate loop in PHP

foreach loop ::

foreach($data as $value){

}


for loop ::


for($i=0;$i<=count($data);$i++){

}


While loop ::

$i=0;
while($i<=count($data))
$i++;
}


Mitul Dabhi

Mitul Dabhi
answered Nov 30 '-1 00:00

you can use goto statement :


b:
goto a;
a:
echo i;
i++;
goto b;


Post Answer