<?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 function to count the number of vowels in a string. |
How to check if a given number is a perfect number. |
how to get response status in api using curl php? |
Write a PHP script that generates and displays a simple multiplication table for the numbers 1 to 5. |
Write a PHP script that generates and displays a list of the first 10 Fibonacci numbers. |
Create a PHP script that prints the current date and time. |
How to call travelport catalogproductofferings api using php? |
Write a PHP script that sets a cookie with user preferences and retrieves it on subsequent visits. |
