<?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
Create a PHP script that calculates the average of an array of numbers. |
How to convert a temperature from Celsius to Fahrenheit using php. |
Write a PHP script that checks if a given string is a valid email address. |
Write a PHP script that generates a random password of a specified length. |
what is PhpUnit? |
How to check if a given number is a perfect number. |
Write a PHP script that generates and displays a list of the first 10 Fibonacci numbers. |
how to get current lat and lng from ip address using google map api in php? |