Re: Where am i screwing up?
| From: | Ivo Fokkema | Date: | Thu, 31 Jul 2003 14:56:11 +0000 |
| Subject: | Re: Where am i screwing up? | ||
| References: | 1 2 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-157743@lists.php.net to get a copy of this message | ||
"John Manko" <xerid@adelphia.net> wrote in message
news:3F292CBB.6040603@adelphia.net...
> Can someone correct me on this if i'm wrong.......
>
> try (meaning, I think that $vars as $keys will put the value into $key,
> not the key itself):
>
> foreach ($vars as $key=>$value) // clear all previous sessions
> {
> if(isset($_SESSION['$key']))
> {
> unset($_SESSION['$key']);
> }
> }
This is no good, now it's going to delete $_SESSION['0'] and so on. This top
function seems OK to me as it was, but using $val in stead of $key should be
clearer.
Ivo