Well, I have another question which is forgotten asking:
While I write a function, I use some temp variables to store the result and I need to loop some steps but I'm lazy to rewrite them. I'm also don't want to group them as a function then call it because I will have to send the temp variables, which is not necessary. I wonder does PHP has somethings can "jump" through the code lines.
For example I write a function like below:
CODE
function a($var) {
switch ($var) {
case 'a':
condition1 -> do action1 if true
break;
case 'b':
condition2 -> do action2 and actionX if true
break;
case 'c':
condition3 -> do action3 and actionX if true
break;
default:
do actionX
}
}
Suppose that the
actionX is writen below
default, so how I call it after checking the
condition2 or
condition3.
My English is not good and I really feel it is very hard to explain my trouble so maybe it's hard to understand.
As a short, it like
GoTo statement in VB language.
Anyone who knows it please answer me.
Comment/Reply (w/o sign-up)