This is all i've ever been able to do:
function ck_removeValueFromArray($array, $value) {
$key = array_search($value, $array);
if ($key) {
$array[$key] = "";
rsort($array); // rsort() puts blank values at the end
reset($array);
array_pop($array); //use array_pop to remove the blank
}
return $array;
}
MC> Howdy,
MC> If someone out there could tell me how to get rid of a single key/index pair
within an array, it would be great. I've tried both unset() and empty(), but both
destroy the entire array.
MC> Please CC me directly, as I'm on the digest.
MC> Thanks in advance!
MC> Martin
MC> --
MC> PHP General Mailing List (http://www.php.net/)
MC> To unsubscribe, visit: http://www.php.net/unsub.php
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php