function to remove a specified element from an array?
Posted: Thu Feb 26, 2009 2:31 pm
I'm looking for a function to remove a specified element from an array, but I haven't been able to find one in the php manual.
For example, if I have an indexed array with six elements, how could I remove $array[2] in such a way that $array[3] through $array[5] all drop down a number to fill the gap left behind by the deleted $array[2], leaving an array of five elements?
Seems like this should be common enough, but I can't find a function for it.
Thank,
Drew
For example, if I have an indexed array with six elements, how could I remove $array[2] in such a way that $array[3] through $array[5] all drop down a number to fill the gap left behind by the deleted $array[2], leaving an array of five elements?
Seems like this should be common enough, but I can't find a function for it.
Thank,
Drew