06-25-2009, 10:35 PM
|
#8 (permalink)
|
|
La Vida es Sueño
Join Date: Sep 2007
Location: Oldham
Posts: 2,258
Thanks: 90
|
Yes. That's another way to do it, which is pretty much as below. Although I added them into a function for him.
php Code:
while (($iKey = array_search($szSearch, $aArray)) !== false){ unset($aArray[ $iKey] ); }
Then he also wanted to delete all the items whilst supplying many values, too. Which is just a loop inside a loop:
php Code:
foreach ($mSearch as $szSearch){ while (($iKey = array_search($szSearch, $aArray)) !== false) { unset($aArray[ $iKey] ); }}
Unless array_keys allows you to pass in an array, then you're also going to need a loop inside a loop.
__________________
The man who comes back through the Door in the Wall will never be quite the same as the man who went out.
|
|
|