<?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. |
Create a PHP script that checks whether a given number is a prime number or not. |
Create a PHP script that calculates the average of an array of numbers. |
Write a PHP script that generates a random password of a specified length. |
Write a PHP script that connects to a MySQL database and fetches data from a table. |
How to convert a temperature from Celsius to Fahrenheit using php. |
Write a PHP script that generates and displays a simple multiplication table for the numbers 1 to 5. |
Create a PHP script that counts the number of occurrences of each word in a given sentence. |