switch vs elseif
| From: | Frank Stanovcak | Date: | Mon, 12 Jan 2009 20:15:43 +0000 |
| Subject: | switch vs elseif | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-286134@lists.php.net to get a copy of this message | ||
I've googled, and found some confusing answers.
I've tried searching the history of the news group, and only found info on
switch or elseif seperately. :(
Strictly from a performance stand point, not preference or anything else, is
there a benefit of one over the other?
for($i=0;$i<3;$i++){
switch($i){
case 0:
header pg1 code
break;
case 1:
header pg2 code
break;
case 3:
header pg3 code
break;
};
};
or would that be better served using an if...elseif structure?
Frank