sitorush Posted May 4, 2007 Share Posted May 4, 2007 Hello friends i want to know what is the syntax for, "exit for" in PHP. ex. for ($row=0; $row<$baris; $row++) { echo "<tr>\n"; for ($col=0; $col<$kolom; $col++) { if (isset($chart [ 'tampil' ] [$row] [$col])) { echo $string1.$chart [ 'tampil' ] [$row] [$col].$string2 ; } } echo "</tr>\n"; } i want to make --- else { exit both "for loop" thanks for your help... sitorush. Quote Link to comment https://forums.phpfreaks.com/topic/49946-solved-exit-for/ Share on other sites More sharing options...
genericnumber1 Posted May 4, 2007 Share Posted May 4, 2007 <?php for($i = 0; $i < 100 ++$i) { for($j = 0; $j < 100 ++$j) { feed('joe'); if($joe == 'full') { break 2; } } } ?> Quote Link to comment https://forums.phpfreaks.com/topic/49946-solved-exit-for/#findComment-245167 Share on other sites More sharing options...
sitorush Posted May 4, 2007 Author Share Posted May 4, 2007 ah.. i see break 2; thank you very much. Quote Link to comment https://forums.phpfreaks.com/topic/49946-solved-exit-for/#findComment-245173 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.