RE: [PHP] Please help with Array..
| From: | joakim dot andersson at cybercom dot se | Date: | Fri, 19 Jul 2002 13:28:40 +0000 |
| Subject: | RE: [PHP] Please help with Array.. | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-108489@lists.php.net to get a copy of this message | ||
> -----Original Message-----
> From: Wee Keat [mailto:weekeat@amorphosium.com]
> Sent: Friday, July 19, 2002 3:13 PM
> To: PHP General
> Subject: [PHP] Please help with Array..
>
>
> Hi all how are yas?
>
> I have one question for which I could not find the answer:
>
> How do I remove an element of an array with a specific key or index?
>
> To be clearer:
>
> Lets say I have an array $shoppingCart[] (quite a
> lot of them)
> I want to delete $shoppingCart[345] (which is not
> the last or the first)
> How do I do it?
>
>
> I have checked the PHP manual... it has array_pop,
> array_shift which are for the last element and the first
> element. But what about specific elements in between the
> first and the last?
>
> Please help out... I'm really in a rush to finish my project... :(
>
> Thanks soooo much in advance for your time.
>
>
> Yours,
> Wee Keat Chin
>
> ---------------------------------------------------
>
> "Man is only truly great when he acts from his passions."
>
unset($shoppingCart[345]);
Regards
Joakim Andersson