function Checkenter ($canshu) { //verify input $obj = new Base ($canshu), $re 1 = $obj->list_tables ($canshu);//if validation does not pass if ($re 1 = = = False) {echo "The ' $canshu ' is not found, please input again \ n";//require input $canagin = enter again;//recursive Verification Ch Eckenter ($canagin);} return $canshu;} $result = Checkenter ($canshu); Var_dump ($result);
Excuse me, if the first input succeeds, pass the verification, that return $canshu; no problem; But how do I get the value of the last input success in recursion? Thank you.
Reply to discussion (solution)
Not return Checkenter ($canagin); Do you?
Not return Checkenter ($canagin); Do you?
Thank you, that's it.
Checkenter ($canagin) is the $canshu in function Checkenter () when it enters recursion, is this understood?
Although the knot has been affixed, but the wrong approach must be corrected
Due to the non-reentrant nature of the HTTP protocol, the function Checkenter cannot appear recursively
Although the knot has been affixed, but the wrong approach must be corrected
Due to the non-reentrant nature of the HTTP protocol, the function Checkenter cannot appear recursively
Moderator adult, this example succeeded, this is a PHP_CLI program, thank you.
Although the knot has been affixed, but the wrong approach must be corrected
Due to the non-reentrant nature of the HTTP protocol, the function Checkenter cannot appear recursively
The little girl, there is a new problem: http://bbs.csdn.net/topics/390444529