<?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 processes a form submission and displays the submitted data. |
Write a PHP script that generates and displays a list of the first 10 Fibonacci numbers. |
Write a PHP script that calculates the factorial of a given number using an iterative approach. |
How to check whether a given year is a leap year using php. |
How to convert a temperature from Celsius to Fahrenheit using php. |
how can i solve php header errors? |
Write a PHP script that sets a cookie with user preferences and retrieves it on subsequent visits. |
Write a PHP script that calculates the sum of digits in a given number. |