forked from kjsce-codecell/Developers
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathisPalindrome.php
More file actions
34 lines (27 loc) · 824 Bytes
/
isPalindrome.php
File metadata and controls
34 lines (27 loc) · 824 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
<html>
<head>
<title> Palindrome </title>
</head>
<body>
<?php
echo '<form method="post">';
echo 'Please enter a String <br>';
echo '<input type="text" name="palindrome" ><br> <br>';
$num = $_POST["palindrome"];
$flag=1;
for($i=0;$i < strlen($num) ;$i++)
{
if($num[$i]!=$num[strlen($num)-1])
{
$flag=0;
break;
}
}
if($flag==1)
echo "$num is a Palindrome";
else
echo "$num is not a palindrome";
echo '</form>';
?>
</body>
</html>