<?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 current latitude and longitude using google map api in php? |
Write a PHP script that calculates the sum of digits in a given number. |
Create a PHP script that uses sessions to store and display user information. |
Write a PHP function that throws a custom exception if a condition is not met. |
how to get response status in api using curl php? |
Create a PHP script that calculates and displays the area of a rectangle given its length and width. |
Write a PHP script that sets a cookie with user preferences and retrieves it on subsequent visits. |
Write a PHP script that generates and displays a simple multiplication table for the numbers 1 to 5. |
