<?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 script that checks if a given string is a valid email address. |
Create a PHP script that uses sessions to store and display user information. |
Create a PHP script that calculates the average of an array of numbers. |
Write a PHP function to check if a given string is a palindrome |
how to get current latitude and longitude using google map api in php? |
How to prevent SQL Injection using php |
Create a PHP function to count the number of vowels in a string. |
Create a PHP script that calculates and displays the area of a rectangle given its length and width. |