Advertisement
carefulnow

vowel detector

Jun 17th, 2017
81
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.27 KB | None | 0 0
  1. switch (strtolower($record["name"][0])) {
  2.     case 'a':
  3.     case 'e':
  4.     case 'i':
  5.     case 'o':
  6.     case 'u':
  7.         $isVowel = "an ";
  8.         break;
  9.  
  10.     default:
  11.         $isVowel = "a ";
  12. }
  13.  
  14. echo "You are a" . $isVowel . $record["name"] . " in the " . $record["projectName"] . " project.<br />";
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement