<?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 and displays the area of a rectangle given its length and width. |
Create a PHP script that counts the number of occurrences of each word in a given sentence. |
Write a PHP script that parses JSON data and displays specific information. |
How to show location using google map in JavaScript? |
How to convert a temperature from Celsius to Fahrenheit using php. |
Create a PHP script that prints the current date and time. |
Create a PHP script that calculates the average of an array of numbers. |
Create a PHP function to count the number of vowels in a string. |