continue and break statements in php are very importants
these are very usefull in loops if you want to skip at any point in loop and you want that after this condition below code should not be executed then use continue
these are very usefull in loops if you want to skip at any point in loop and you want that after this condition below code should not be executed then use continue
example:
for($i=0;$i<10;$i++){
if($i==6)
break;// loop will be terminated and after 6 it will be outside from loop scope
echo "before continue";
continue;
echo "after continue";//this will never be executed
}
Comments
Post a Comment