A palindrome is a word or phrase that is identical forward or backward, such as the word "racecar." A standard palindrome is similar to a perfect palindrome, except that spaces and punctuation are ignored in a standard palindrome.
For example, "Madam, I'm Adam" is a standard palindrome because the characters are identical forward or backward, provided you remove the spaces and punctuation marks.
Write a PHP script that checks a word or a phrase (stored in a string variable) to determine if it is a standard palindrome, a perfect palindrome, or not a palindrome at all.
Also, for each letter that the word/phrase contains, count and print the number of times that each consonant and vowel is encountered.
Your output will look as follows:
Word/phrase: racecar
Perfect palindrome
Contains consonants:
r - 2
c - 2
Contains vowels:
a - 2
e - 1