note 30037 added to control-structures.switch
| From: | kriek at jonkriek dot com | Date: | Wed, 05 Mar 2003 00:13:01 +0000 |
| Subject: | note 30037 added to control-structures.switch | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-44843@lists.php.net to get a copy of this message | ||
Nice, clean, template style navigation. In most cases it is fifteen percent faster to use
switch/case/break instead of if/elseif/else. Of course this depends on your application and
individual code results do very.
<?php
switch ($_GET['go']) {
case "1": $inc = 'Page01.php';
break;
case "2": $inc = 'Page02.php';
break;
case "3": $inc = 'Page03.php';
break;
case "4": $inc = 'Page04.php';
break;
default: $inc = 'Page01.php';
break;
}
include ($inc);
?>
--
http://www.php.net/manual/en/control-structures.switch.php
http://master.php.net/manage/user-notes.php?action=edit+30037
http://master.php.net/manage/user-notes.php?action=delete+30037
http://master.php.net/manage/user-notes.php?action=reject+30037