![]() |
PHP - Select Case / Switch help (looking for a good example)
I spent some time searching for a good php select case / switch example, but the one I found doesn't seem to work... Maybe I can get a better example since it's about 20 or so cases total, and I don't want to do that on if/elses :) I've taken out other things inside of them for sanity.
PHP Code:
|
If you have trouble with php code look for an example within vBulletin or other scripts, here is an example of a proper switch statement, you can find it in memberlist.php in vBulletin 3.0.3
PHP Code:
|
Well, it doesn't use "to"s, or numbers, but I suppose I can try again. I did look at the memberlist one before :)
UPDATE : For future refrence or similar questions, it's like this... PHP Code:
PHP Code:
|
Generaly text has to be in quotes, but numbers don't.
|
The only way to do what you wanna do without having heaps of code is to do the following:
PHP Code:
|
Quote:
PHP Code:
PHP Code:
|
All times are GMT. The time now is 07:50 AM. |
Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
![]() |
|
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|