<?php
function isPalindrome($str) {
$reversed = strrev($str);
return strtolower($str) === strtolower($reversed);
}
// Example usage:
$result = isPalindrome('level');
echo $result ? 'Palindrome' : 'Not a Palindrome';
?>
<?php
function isPalindrome($str) {
$reversed = strrev($str);
return strtolower($str) === strtolower($reversed);
}
// Example usage:
$result = isPalindrome('level');
echo $result ? 'Palindrome' : 'Not a Palindrome';
?>
Related
How to check whether a given year is a leap year using php. |
Write a PHP function to check if a given string is a palindrome |
Write a PHP script that checks if a given string is a valid email address. |
Create a PHP script that processes a form submission and displays the submitted data. |
How to reverses a given string using PHP. |
How to convert a temperature from Celsius to Fahrenheit using php. |
Write a PHP script that parses JSON data and displays specific information. |
how to get current latitude and longitude using google map api in php? |