Write a PHP function that checks whether a passed string is a palindrome or not?
A palindrome is word, phrase, or sequence that reads the same backward as forward, e.g., madam or nurses run.
<?php function check_palindrome($string) { if ($string == strrev($string)) return 1; else return 0; } echo check_palindrome('madam')."\n"; ?>
Sample Output:
1
total answers (1)
start bookmarking useful questions and collections and save it into your own study-lists, login now to start creating your own collections.
Sample Output:
need an explanation for this answer? contact us directly to get an explanation for this answer