RE: [PHP] passing arrays?
| From: | motorpsychkill | Date: | Fri, 12 Dec 2003 06:06:54 +0000 |
| Subject: | RE: [PHP] passing arrays? | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-172549@lists.php.net to get a copy of this message | ||
Thanks Tom, that worked! I knew that $$level had something to do with it,
just wasn't sure what exactly. Thanks again.
-m
-----Original Message-----
From: Tom Rogers [mailto:trogers@kwikin.com]
Sent: Thursday, December 11, 2003 9:34 PM
To: motorpsychkill
Subject: Re: [PHP] passing arrays?
Always use isset() to check if something exists before trying to use it if
originates externally to the running script.
you probabley need something like this
$level_0 = array('NONE');
$level_1 = array("PN", "GALUP", "VP", "PUBUP",
"STATS", "MCI",
"CONLIST","CP", "OAFS", "LO");
$level_2 = array("PN", "GALUP", "VP", "PUBUP",
"MCI", "CONLIST", "CP",
"OAFS", "LO");
if(isset($_SESSION['user']['level'])){
$level = 'level_'.$_SESSION['user']['level'];
}else{
$level = 'level_0'; //catchall value
}
foreach($$level as $value){
echo $value.'<br>';
}
--
regards,
Tom