Showing posts with label palindrome or not in php. Show all posts
Showing posts with label palindrome or not in php. Show all posts

Saturday, 29 June 2013

palindrome or not in php

<html>
<head>
<title> palindrome</title>
</head>
<?php
function pal()
{
$s=121;
$p=strrev($s);
if(strcmp($s,$p)==0)
{
echo " palindrome";
}
else
{
echo "not palindrome";
}

} pal();
?>
</body>
</html>