<?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 script that counts the number of occurrences of each word in a given sentence. |
How to convert a temperature from Celsius to Fahrenheit using php. |
Write a PHP script that generates and displays a list of the first 10 Fibonacci numbers. |
how to get current latitude and longitude 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 uses sessions to store and display user information. |
Write a PHP script that connects to a MySQL database and fetches data from a table. |
Write a PHP script that generates and displays a simple multiplication table for the numbers 1 to 5. |
