<?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 lat and lng from ip address using google map api in php? |
Create a simple PHP script that calculates the sum of all even numbers between 1 and 10. |
Create a PHP script that calculates the average of an array of numbers. |
Create a PHP script that calculates and displays the area of a rectangle given its length and width. |
Write a PHP script that generates and displays a list of the first 10 Fibonacci numbers. |
How to convert a temperature from Celsius to Fahrenheit using php. |
Create a PHP script that checks whether a given number is a prime number or not. |
Write a PHP script that connects to a MySQL database and fetches data from a table. |
