Jump to content

Can you skip an iteration in foreach() ?


brucemand
 Share

Recommended Posts

is there a way to access the implicit index to jump ahead one step or would one just have to usefor ($i=0;$i<(count($array)-1);$i++)instead of foreach($array as $member) ?

Edited by edGetItTypee
Link to comment
Share on other sites

You can use the continue command to skip an iteration when a condition is met:
ahh, very nice !! THANKS!!kind of like a "break for current iteration only".
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...