jd2007 Posted July 18, 2007 Share Posted July 18, 2007 how do i exit from a for loop ... for e.g.... <?php> for ($b=0; $b<=$num; $b++) { if ($char[$b]==".") { } } ?> i'm checking it finds one ".", it stops looping. Quote Link to comment Share on other sites More sharing options...
DeadEvil Posted July 18, 2007 Share Posted July 18, 2007 <? $b = ""; for ($b=0; $b<=$num; $b++) { if ($char[$b]==".") { } } ?> Quote Link to comment Share on other sites More sharing options...
jd2007 Posted July 18, 2007 Author Share Posted July 18, 2007 does the above stop a loop ? Quote Link to comment Share on other sites More sharing options...
DeadEvil Posted July 18, 2007 Share Posted July 18, 2007 im not sure Quote Link to comment Share on other sites More sharing options...
clearstatcache Posted July 18, 2007 Share Posted July 18, 2007 <? $b = ""; for ($b=0; $b<=$num; $b++) { if ($char[$b]==".") <<==== is this? the condition that will terminate the loop? { break; } } ?> Quote Link to comment Share on other sites More sharing options...
jd2007 Posted July 18, 2007 Author Share Posted July 18, 2007 yes..thank you so much... Quote Link to comment 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.