[thelist] php SWITCH vs ELSE IF

Jay Blanchard jblanchard at pocket.com
Mon Apr 24 07:55:41 CDT 2006


[snip]
I have written a short code to display a certain menu depending on which

page it is on. the code works fine and I do get my desired results.

i am using an ELSE IF statement and would like to know if this would be 
better than using a switch statement.

sorry if this is a simple question but i was unable to find the answer 
with google and php websites.
[/snip]

Well there is no right answer here. However a case statement will
probably easier to organize. http://www.php.net/switch





More information about the thelist mailing list