Re: remove element from array

From: Date: Mon, 03 Jul 2000 17:55:16 +0000
Subject: Re: remove element from array
Groups: php.general 
Request: Send a blank email to php-general+get-4542@lists.php.net to get a copy of this message
You might try array_slice and array_merge. Take the array_slice prior to the element you want to remove, and the slice after. Then merge the two slices back into one array. Hope this helps, Joe -----Original Message----- From: Erb, Maria <merb@keene.edu> To: 'php-general@lists.php.net' <php-general@lists.php.net> Date: Monday, July 03, 2000 10:41 AM Subject: [PHP] remove element from array >hi all, > >How can I remove an element from the middle of an array? I've tried unset >but it doesn't seem to completely remove everything. I am serializing an >array and then storing it in MySQL and with unset, not all of the codes or >encryption (don't know if this is the right term) associated with the >serializing was removed. Anyway, is there another way to do this task? >I've tried moving the element to the end of the array and then popping it >off, but that still doesn't get rid of it from its original place in the >array. I'm using php4. Thanks for the help!!! > >Maria > >Maria B. Erb >Web Developer >Keene State College >603-358-2340 > >mail address: >MS 2707 / CMIT >229 Main Street >Keene, NH 03435 > > >-- >PHP General Mailing List (http://www.php.net/) >To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net >For additional commands, e-mail: php-general-help@lists.php.net >To contact the list administrators, e-mail: php-list-admin@lists.php.net >

« previous php.general (#4542) next »