Re: Replacement functions for array functions
| From: | Sterling Hughes | Date: | Sat, 22 Jul 2000 20:45:43 +0000 |
| Subject: | Re: Replacement functions for array functions | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-7716@lists.php.net to get a copy of this message | ||
> >> The array functions were added in php4.
> >>
> >> Does somebody have replacement functions for php3 ?
> >>
> >> I need to use array_push en array_unshift ?
> >
> >As per the documentation, array_push() is the same as doing:
> >
> > $arr[] = "foo";
>
> ok thanks...
>
> >array_unshift() is a bit tougher in PHP 3. I'd suggest doing it by
> >keeping track of your indices and just inserting a value with a lower
> >index.
>
> euhm... with array_unshift je can remove the first element of an array...
not insert it.
>
No, array_unshift(), inserts an element.
-Sterling