Break Vs Continue in PHP

Break Vs Continue in PHP

Break Stops the Execution in PHP

For example: ( will Out put : 01 , execution stops after $i==2)


 for($i=0;$i<$length;$i++):
             if($i==2):

                  break;
         echo $i;


    endfor;

Continue skip the Operation in PHP ( will Out put : 0134 as it skip 2)


 for($i=0;$i<$length;$i++):

           if($i==2):

                  continue;
       echo $i;

        endfor;


 

Vistosys
No Comments

Post a Comment

Comment
Name
Email
Website