Hello,
I was wondering if it is possible to build up a switch() routine dynamically, based on how many elements there are in an array.
So if there are 3 elements in this array, my switch would need to look like:
PHP Code:
switch ($variable) { case 1: //do stuff break;
case 2: //do stuff break;
case 3: //do stuff break;
default: //do stuff break; }
Or, if there are 2 elements in this array, my switch would need to look like:
PHP Code:
switch ($variable) { case 1: //do stuff break;
case 2: //do stuff break;
default: //do stuff break; }
Is this somehow possible?
thanks!
Matt
|