<?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
Write a PHP function that throws a custom exception if a condition is not met. |
How to check if a given number is a perfect number. |
how to get country, state and city select option using google map api in php |
Create a PHP script that calculates and displays the area of a rectangle given its length and width. |
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 |
How to call travelport catalogproductofferings api using php? |
How to get the largest element in an array of numbers |
