Re: reducing array size
| From: | Jason Wong | Date: | Sat, 16 Apr 2005 15:57:50 +0000 |
| Subject: | Re: reducing array size | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-213206@lists.php.net to get a copy of this message | ||
On Saturday 16 April 2005 23:07, pete M wrote:
> Is there an easy way to "trim" an array ?
>
> I'm using array_unshift to push elemnts onto the front of an array but
> I want to limit the size to 20 ??
>
> Is there an easy way to do this without "looping" and unsetting the
> elements ??
array_slice(), array_splice()
--
Jason Wong -> Gremlins Associates -> www.gremlins.biz
Open Source Software Systems Integrators
* Web Design & Hosting * Internet & Intranet Applications Development *
------------------------------------------
Search the list archives before you post
http://marc.theaimsgroup.com/?l=php-general
------------------------------------------
New Year Resolution: Ignore top posted posts