Posted by Hilarion on 07/22/05 12:48
> is it possible to call on a case statement within a case?
>
> for ex:
>
> switch ($xyz)
> {
>
> case 'case1':
> //some code
> break;
>
> case 'case2':
> //some code
> ***here i would like to trigger case1***
> break;
>
> }
Change order of cases and remove one "break":
switch ($xyz)
{
case 'case2':
//some code
//No "break" causes the execution to continue
//in the 'case1' code.
case 'case1':
//some code
break;
}
Hilarion
[Back to original message]
|