note 6665 modified in array_splice by ronabop
| From: | ronabop@php.net | Date: | Wed, 18 Oct 2000 04:32:16 +0000 |
| Subject: | note 6665 modified in array_splice by ronabop | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-6622@lists.php.net to get a copy of this message | ||
I've got The Answer: use unset(). i.e.
$example = array (
"a" => "alpha",
"b" => "beta",
"d" => "delta",
"g" => "gamma"
);
print_r($example);
gives:
Array ( [a] => alpha [b] => beta [d] => delta [g] => gamma )
Now use unset()
unset($example['d']);
print_r($example);
gives:
Array ( [a] => alpha [b] => beta [g] => gamma )
I came across this by accident; I can't believe they didn't note this here.
http://www.php.net/manual/function.array-splice.php