Exercise Weekend

It's time for you to play with some functions! Create a website with a form in it for the user to enter four strings of text.

  • Take the first one and use strtoupper to make it uppercase and print it to the screen. It takes a string as its only argument.
  • Use str_word_count to count the number of words in the second string. Then print that to the screen. It also takes a string as its only argument.
  • Use str_shuffle to shuffle the order of the characters in the third string. It also takes a string as its only argument.
  • Use stripos to output the numbered position (called the index) of the first occurrence of the word "you" (or another word of your choice). It takes two arguments - the first one is the string we are searching in, and the second one is the string we are searching for. For example, if you type stripos("How are you?", "you"); It will give you the answer 8 because the word "you" starts on the 8th character in the phrase (counting from 0, including spaces). "H" is at index 0, "o" is index 1, "w" is index 2, etc. Most everything in programming counts from 0 instead of 1. Don't worry, you'll get used to it.