note 43626 deleted from function.unset by tomsommer
| From: | tomsommer@php.net | Date: | Mon, 28 Jun 2004 15:13:20 +0000 |
| Subject: | note 43626 deleted from function.unset by tomsommer | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-72043@lists.php.net to get a copy of this message | ||
Note Submitter: dasprid@web.de
----
This is my function to completly clear an array. The only problem is, that it can't destroy the
array.
<?php
function unset_array (&$array) {
if (!is_array($array)) return false;
foreach ($array AS $key => $value) {
if (is_array($array[$key])) unset_array($array[$key]);
unset($array[$key]);
}
return true;
}
?>