Write a function countWords($str) that takes any string of characters and finds thenumber of times each word occurs. You should ignore the distinction between capital and lowercase letters, anddo not have to worry about dealing with characters that are not letters. Hint: Create an associative array mappingword keys to the number of times they occur. You will need to look at PHP's string functions to split a sentenceinto words. Hint 2: The print_r($array_name) function is useful for examining the contents of an array