difference between break continue exit in php
php feilong 2011208 ~ 2011610 633What the difference between break continue or exit in php?Here feilong give some tips and a sample.
1.continue:skip the present, to the next.
2.break:out of the loop,
3.exit out of the php
Sample,
$i = 1;while (true) { if ($i==2) { $i++;continue;// skip 2 and go to the next } elseif ($i==5) { break;// go out of the loop } else { echo $i . "\n>"; } $i++; } exit; echo 'continue skip present.break go out of the loop,exit ';
