<?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
how to get country, state and city select option using google map api in php |
Write a PHP script that sets a cookie with user preferences and retrieves it on subsequent visits. |
Create a PHP script that uses sessions to store and display user information. |
Create a PHP script that checks whether a given number is a prime number or not. |
Write a PHP script that parses JSON data and displays specific information. |
Create a PHP script that counts the number of occurrences of each word in a given sentence. |
Create a PHP script that calculates the average of an array of numbers. |
Write a PHP script that calculates the factorial of a given number using an iterative approach. |
