Is there a way to set a limit on loop executions?
Say I have an array of 100 emails and a script that loops through it and sends message to each email. Can I limit it to first 50, for example?
You could use a for loop with a counter.
You could just increment a counter and stop when it reaches your limit.
P.
I think I know what you mean but am having difficulty putting it together.
It can't really be like this:
for($i = 0; $i < 50; $i++) { foreach ($myList as $lst) { ... } }
or
for($i = 0; $i < 50; $i++; $myList as $lst) { ... }
I was thinking ...
for($i = 0; $i < 50; $i++){ echo $myList[$i]; }
P