note 31800 deleted from control-structures.switch by crell
| From: | crell@php.net | Date: | Mon, 27 Jun 2022 21:34:00 +0000 |
| Subject: | note 31800 deleted from control-structures.switch by crell | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-218648@lists.php.net to get a copy of this message | ||
Note Submitter: shawn at evilest dot net
----
You can also nest switch statements inside case statements:
<?php
// Set argument handlers
$argv = explode(",", urldecode(getenv('QUERY_STRING')));
$argc = array_shift($argv);
$argd = array_shift($argv);
$arge = array_shift($argv);
?>
// Begin switching
<?php
switch ($argc) {
case 'home': {
print('This is $argc, home case.');
break;
}
case 'subsection': {
switch ($argd) {
case 'links': {
switch($arge) {
case 'display': {
print('This is $arge, subsection,links,display case.');
break;
}
}
}
}
}
}
?>