fork download
  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4. <meta charset="UTF-8">
  5. <meta name="viewport" content="width=device-width, initial-scale=1.0">
  6. <title>Document</title>
  7. </head>
  8. <body>
  9. <form method="get">
  10. Enter a string : <input type="text" name="str"/><br><br>
  11. <input type="submit" name="submit" value="Check palindrome"/><br>
  12. </form>
  13. <?php
  14. if(isset($_GET['submit']))
  15. {
  16. $str=$_GET['str'];
  17. $rev=strrev(($str));
  18. if($str == $rev)
  19. {
  20. echo $str . " is a palindrome ";
  21. }
  22. else{
  23. echo $str . " is not a palindrome ";
  24. }
  25.  
  26. }
  27.  
  28. ?>
  29. </body>
  30. </html>
  31.  
  32.  
Success #stdin #stdout 0.02s 26204KB
stdin
Standard input is empty
stdout
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <form method="get">
        Enter a string : <input type="text" name="str"/><br><br>
        <input type="submit" name="submit" value="Check palindrome"/><br>
</form>
</body>
</html>