note 30803 added to control-structures

From: Date: Sat, 29 Mar 2003 13:06:46 +0000
Subject: note 30803 added to control-structures
Groups: php.notes 
Request: Send a blank email to php-notes+get-45977@lists.php.net to get a copy of this message
It should be noted that 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 if ($_GET['page']) { $page = $page . '.php'; if (file_exists($page)) { include($page); } } else { include('welcome.php'); } if ($_GET['auc']) { $auc = $auc . '.html'; if (file_exists($auc)) { include($auc); } } else { include('welcome.html'); } ?> -- http://www.php.net/manual/en/control-structures.php http://master.php.net/manage/user-notes.php?action=edit+30803 http://master.php.net/manage/user-notes.php?action=delete+30803 http://master.php.net/manage/user-notes.php?action=reject+30803

« previous php.notes (#45977) next »