Jump to content

While transversing a while


george

Recommended Posts

I have my basic while:

$i = 1;while ($i <= 10):	echo $i;	$i++;endwhile;

where I count up to ten. But suppose I want to skip six. I do not want the

if ($i!=6) echo $i

solution. I want to catch the condition, increment the internal array pointer, and restart execution right after the while. The 'next' command comes close to this, but it does not stop execution of the loop at that point and restart execution at the top of the while.

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...