Re: Please help with array

From: Date: Fri, 19 Jul 2002 13:51:19 +0000
Subject: Re: Please help with array
Groups: php.general 
Request: Send a blank email to php-general+get-108616@lists.php.net to get a copy of this message
try with array_slice like array_slice($shoppingCart,345,1); this is one of the way to delete. >>>> Date: Fri, 19 Jul 2002 23:13:10 +1000 From: Wee Keat <weekeat@amorphosium.com> To: PHP General <php-general@lists.php.net> Newsgroups: php.general Subject: 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."

« previous php.general (#108616) next »