<?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 get current latitude and longitude using google map api in php? |
Write a PHP script that sets a cookie with user preferences and retrieves it on subsequent visits. |
Write a PHP script that calculates the factorial of a given number using an iterative approach. |
Create a PHP script that checks whether a given number is a prime number or not. |
Write a PHP script that checks if a given string is a valid email address. |
How to check if a given number is a perfect number. |
How to call travelport catalogproductofferings api using php? |
Write a PHP script that generates and displays a list of the first 10 Fibonacci numbers. |