SHARE
TWEET

Untitled

a guest Aug 12th, 2017 50 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. 19. Rewrite the following code:
  2. function assign_value($num)
  3. {
  4.  // accepts numbers 1 – 6
  5.  switch($num)
  6.  {
  7.  case "1":
  8.  $rand_value = "a";
  9.  break;
  10.  case "2":
  11.  $rand_value = "b";
  12.             break;
  13.         case "3":
  14.             $rand_value = "c";
  15.             break;
  16.         case "4":
  17.             $rand_value = "d";
  18.             break;
  19.         case "5":
  20.             $rand_value = "e";
  21.             break;
  22.         case "6":
  23.             $rand_value = "f";
  24.             break;
  25.     }
  26.     return $rand_value;
  27. }
RAW Paste Data
Top