Re: Limit iterations on a foreach loop?
| From: | Greg Donald | Date: | Fri, 11 Feb 2005 16:09:23 +0000 |
| Subject: | Re: Limit iterations on a foreach loop? | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-208525@lists.php.net to get a copy of this message | ||
On Thu, 10 Feb 2005 15:58:28 -0800, Brian Dunning
<brian@briandunning.com> wrote:
> I'm using an RSS feed that has WAY too much content, I only want the
> first 10. I'm outputting the array with a foreach loop: is there a way
> to limit it to only go through the first 10?
Use a counter variable and break.
php.net/break
--
Greg Donald
Zend Certified Engineer
http://destiney.com/