A palindrome is a word or phrase that is identical when you read from forward or backward, such as the words “racecar” and “madam.” 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 words or phrases stored in two separate string variables to determine if they are a perfect palindrome. In addition, see if you can modify the program to check for standard palindromes. create a web page with a text field and “Reset” and “Submit” buttons. When a user clicks on the submit button, show the standard and perfect palindromes of the string that was entered in the text field on the same page.

EBK JAVA PROGRAMMING
9th Edition
ISBN:9781337671385
Author:FARRELL
Publisher:FARRELL
Chapter7: Characters, Strings, And The Stringbuilder
Section: Chapter Questions
Problem 7PE
icon
Related questions
Question

A palindrome is a word or phrase that is identical when you read from forward or backward, such as the words “racecar” and “madam.” 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 words or phrases stored in two separate string variables to determine if they are a perfect palindrome. In addition, see if you can modify the program to check for standard palindromes.

create a web page with a text field and “Reset” and “Submit” buttons. When a user clicks on the submit button, show the standard and perfect palindromes of the string that was entered in the text field on the same page.

Palindrome Tester
Type a string for testing
palindrome
testing:
Reset Submit
Result:
testing is not a standard palindrome.
testing is not a perfect palindrome.
Palindrome Tester
Type a string for
palindrome
testing:
madam
Reset Submit
Result:
madam is a standard palindrome.
madam is a perfect palindrome.
Transcribed Image Text:Palindrome Tester Type a string for testing palindrome testing: Reset Submit Result: testing is not a standard palindrome. testing is not a perfect palindrome. Palindrome Tester Type a string for palindrome testing: madam Reset Submit Result: madam is a standard palindrome. madam is a perfect palindrome.
Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 3 steps with 3 images

Blurred answer
Knowledge Booster
Problems on Dynamic Programming
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
EBK JAVA PROGRAMMING
EBK JAVA PROGRAMMING
Computer Science
ISBN:
9781337671385
Author:
FARRELL
Publisher:
CENGAGE LEARNING - CONSIGNMENT
Microsoft Visual C#
Microsoft Visual C#
Computer Science
ISBN:
9781337102100
Author:
Joyce, Farrell.
Publisher:
Cengage Learning,