Return Random Number but not 2

php, random, recursion

Solution

Because you're not stopping the function there. the fourth line should read:

return pickServer();

Problem

Why is it this sometimes returns 2? ``` function pickServer(){ $varr = rand(1,4); if($varr==2){ pickServer(); } return $varr; } ```

Original source

Related problems