<?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
Write a PHP script that parses JSON data and displays specific information. |
Write a PHP script that calculates the factorial of a given number. |
Write a PHP script that calculates the sum of digits in a given number. |
how can i solve php header errors? |
Create a PHP script that processes a form submission and displays the submitted data. |
Write a PHP script that calculates the factorial of a given number using an iterative approach. |
Create a PHP script that checks whether a given number is a prime number or not. |
How to reverses a given string using PHP. |
