note 30688 added to control-structures.switch
| From: | kriek at jonkriek dot com | Date: | Tue, 25 Mar 2003 20:58:47 +0000 |
| Subject: | note 30688 added to control-structures.switch | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-45811@lists.php.net to get a copy of this message | ||
PageXX.php was merely an example as file names are much more complex and diverse on my own server.
However if one were to use ONLY ordered file names such as this, that would be very useful.
<?php
switch ($_GET['go']) {
case $go: $go = $go . ".php";
if (file_exists("$go")) {
include("$go");
} else {
include("Main.php");
}
break;
}
?>
Might be better suited for that type of action.
--
http://www.php.net/manual/en/control-structures.switch.php
http://master.php.net/manage/user-notes.php?action=edit+30688
http://master.php.net/manage/user-notes.php?action=delete+30688
http://master.php.net/manage/user-notes.php?action=reject+30688