<?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 show location using google map in JavaScript? |
Write a PHP script that checks if a given string is a valid email address. |
Write a PHP script that generates and displays a simple multiplication table for the numbers 1 to 5. |
how to get response status in api using curl php? |
How to check whether a given year is a leap year using php. |
How to call travelport catalogproductofferings api using php? |
Write a PHP script that parses JSON data and displays specific information. |
Write a PHP script that sets a cookie with user preferences and retrieves it on subsequent visits. |