<?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 connects to a MySQL database and fetches data from a table. |
how can i solve php header errors? |
How to check whether a given year is a leap year using php. |
how to get current latitude and longitude using google map api in php? |
Write a PHP function to check if a given string is a palindrome |
how to get response status in api using curl php? |
Create a PHP script that checks whether a given number is a prime number or not. |
Write a PHP script that calculates the factorial of a given number using an iterative approach. |