Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- 19. Rewrite the following code:
- function assign_value($num)
- {
- // accepts numbers 1 – 6
- switch($num)
- {
- case "1":
- $rand_value = "a";
- break;
- case "2":
- $rand_value = "b";
- break;
- case "3":
- $rand_value = "c";
- break;
- case "4":
- $rand_value = "d";
- break;
- case "5":
- $rand_value = "e";
- break;
- case "6":
- $rand_value = "f";
- break;
- }
- return $rand_value;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement