unset() on arrays
| From: | Erik Price | Date: | Tue, 16 Apr 2002 14:59:30 +0000 |
| Subject: | unset() on arrays | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-93203@lists.php.net to get a copy of this message | ||
Just a quick question -- the man page for unset() doesn't mention anything about unsetting arrays, but does it work the same way? I have this if/elseif/else statement (pseudocode):
$error_msgs = array();
if (there is a problem) {
$error_msgs[] = "error message 1";
} elseif (there is a different problem) {
$error_msgs[] = "error message 2";
} else {
unset($error_msgs);
}
unset()ing the array isn't really crucial, because I don't use the array if $error_msgs is empty. But my code doesn't tell me one way or the other whether or not the array is being unset, and I was just curious if anyone knew for sure whether this works the way I think it does.
Erik
----
Erik Price
Web Developer Temp
Media Lab, H.H. Brown
pricee@hhbrown.com