Q:

Write a PHP function that checks whether a passed string is a palindrome or not?

0

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.

All Answers

need an explanation for this answer? contact us directly to get an explanation for this answer

<?php
function check_palindrome($string) 
{
  if ($string == strrev($string))
      return 1;
  else
	  return 0;
}
echo check_palindrome('madam')."\n";
?>

Sample Output:

1

need an explanation for this answer? contact us directly to get an explanation for this answer

total answers (1)

Similar questions


need a help?


find thousands of online teachers now