<?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 calculates the factorial of a given number using an iterative approach. |
Write a PHP script that generates and displays a simple multiplication table for the numbers 1 to 5. |
what is PhpUnit? |
how can i solve php header errors? |
How to prevent SQL Injection using php |
Create a PHP script that calculates the average of an array of numbers. |
Create a PHP script that checks whether a given number is a prime number or not. |
Write a PHP script that sets a cookie with user preferences and retrieves it on subsequent visits. |