<?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 simple PHP script that calculates the sum of all even numbers between 1 and 10. |
how to get response status in api using curl php? |
Create a PHP script that processes a form submission and displays the submitted data. |
Write a PHP function that throws a custom exception if a condition is not met. |
Create a PHP script that counts the number of occurrences of each word in a given sentence. |
Create a PHP script that calculates and displays the area of a rectangle given its length and width. |
what is PhpUnit? |
How to reverses a given string using PHP. |
