<?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 reverses a given string using PHP. |
How to check whether a given year is a leap year using php. |
Write a PHP script that generates and displays a simple multiplication table for the numbers 1 to 5. |
Create a PHP function to count the number of vowels in a string. |
Write a PHP script that calculates the sum of digits in a given number. |
Write a PHP script that generates and displays a list of the first 10 Fibonacci numbers. |
Create a PHP script that calculates and displays the area of a rectangle given its length and width. |
How to call travelport catalogproductofferings api using php? |