SHOW:
|
|
- or go back to the newest paste.
1 | <?php | |
2 | function test($condition) | |
3 | { | |
4 | - | $result = 'a'; |
4 | + | $results = Array(a,b,c,d,e,f,g,h,i,j); |
5 | - | if ($condition === 1) $result = 'b'; |
5 | + | return $results[$condition+1]; |
6 | - | if ($condition === 2) $result = 'c'; |
6 | + | |
7 | - | if ($condition === 3) $result = 'd'; |
7 | + | |
8 | - | if ($condition === 4) $result = 'e'; |
8 | + | |
9 | - | if ($condition === 5) $result = 'f'; |
9 | + |