<?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 simple PHP script that calculates the sum of all even numbers between 1 and 10. |
Create a PHP script that calculates and displays the area of a rectangle given its length and width. |
How to check if a given number is a perfect number. |
Write a PHP script that connects to a MySQL database and fetches data from a table. |
Write a PHP script that generates a random password of a specified length. |
Write a PHP script that sets a cookie with user preferences and retrieves it on subsequent visits. |
