<?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 reverses a given string using PHP. |
Create a PHP script that uses sessions to store and display user information. |
Create a PHP script that calculates the average of an array of numbers. |
How to prevent SQL Injection using php |
Write a PHP script that parses JSON data and displays specific information. |
Write a PHP script that generates and displays a simple multiplication table for the numbers 1 to 5. |
Create a PHP script that processes a form submission and displays the submitted data. |
