<?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 to check if a given string is a palindrome |
how to get country, state and city select option using google map api in php |
Create a PHP function to count the number of vowels in a string. |
Write a PHP script that parses JSON data and displays specific information. |
Write a PHP script that generates and displays a list of the first 10 Fibonacci numbers. |
Create a PHP script that calculates and displays the area of a rectangle given its length and width. |
how to get current latitude and longitude using google map api in php? |
Write a PHP script that generates a random password of a specified length. |