[PHP] Where am i screwing up?

2003-07-31 Thread Ryan A
Hi, I am just screwing around and getting used to arrays with a foreach thanks to Michael,Jan and Evan from this list and have run into problems. My requirment is pretty simple (code is below too) 1)unset all the sessions that might have been set with reference to the hardcoded array ($vars) 2)if

Re: [PHP] Where am i screwing up?

2003-07-31 Thread John Manko
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']); } } Ryan A wrote: Hi, I

Re: [PHP] Where am i screwing up?

2003-07-31 Thread John Manko
oh, don't forget, '$key' will not get evaluated. $key will. John Manko wrote: 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 {

Re: [PHP] Where am i screwing up?

2003-07-31 Thread Curt Zirzow
* Thus wrote John Manko ([EMAIL PROTECTED]): 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'])) {

Re: [PHP] Where am i screwing up?

2003-07-31 Thread Ivo Fokkema
John Manko [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] 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 {

Re: [PHP] Where am i screwing up?

2003-07-31 Thread CPT John W. Holmes
From: Ryan A [EMAIL PROTECTED] I am just screwing around and getting used to arrays with a foreach thanks to Michael,Jan and Evan from this list and have run into problems. My requirment is pretty simple (code is below too) 1)unset all the sessions that might have been set with reference to

Re: [PHP] Where am i screwing up?

2003-07-31 Thread Curt Zirzow
* Thus wrote Ryan A ([EMAIL PROTECTED]): foreach ($vars as $key) // clear all previous sessions { if(isset($_SESSION['$key'])) { unset($_SESSION['$key']); } } echo done1; //just checking program execution No need to loop here, you can use an else statment in the next loop. And