note 56579 deleted from control-structures.switch by nlopess
| From: | nlopess@php.net | Date: | Wed, 31 May 2006 18:57:10 +0000 |
| Subject: | note 56579 deleted from control-structures.switch by nlopess | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-112672@lists.php.net to get a copy of this message | ||
Note Submitter: kenzy22 at yahoo dot com
----
Here is a way to use switch to check arrays:
//Depending on Group
switch (TRUE) {
case in_array('rma_tac', $userGroup):
$home = "tac_home.php";
break;
case in_array('rma_vp', $userGroup):
$home = "vpmgr_home.php";
break;
case in_array('rma_mgr', $userGroup):
$home = "vpmgr_home.php";
break;
case in_array('rma_rma', $userGroup):
$home = "rma_home.php";
break;
}