ph4x35ccb

Remove lines duplicate

Sep 2nd, 2020 (edited)
269
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.15 KB | None | 0 0
  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>Remode duplicate lines</title>
  7.     <style>
  8.         *{
  9.             margin:0;
  10.             padding: 0;
  11.             box-sizing: border-box;
  12.         }
  13.         body{
  14.             background: #cecece;
  15.             display: grid;
  16.             justify-content: center;
  17.             text-align: center;
  18.         }
  19.     </style>
  20. </head>
  21. <body>
  22.     <div>
  23.         <h1>Remove duplicate lines</h1>
  24.         <p>Code:Paulo Takaracha</p>
  25.         <!--
  26.             02-09-2020
  27.             Deus e  bm diabo nao presta
  28.         -->
  29.     </div>
  30.     <div>
  31.         <form action="" method="post">
  32.             <div>
  33.                 <textarea name="list" id="" cols="80" rows="10"></textarea>
  34.             </div>
  35.             <div>
  36.            
  37.             </div>
  38.             <div>
  39.                 <input type="submit" name="btn">
  40.             </div>
  41.         </form>
  42.     </div>
  43.     <?php
  44.         error_reporting(0);
  45.         set_time_limit(0);
  46.         if(isset($_POST['btn'])){
  47.             $x=$_POST['list'];
  48.             if($x!=''){
  49.                 extract($_POST);
  50.                 $lines = explode(PHP_EOL, $list);
  51.                 $result = array_unique($lines);
  52.                 $y = count($result);
  53.                 foreach ($result as $_lines) {
  54.                     echo "<br>";
  55.                     echo $_lines;
  56.                 }
  57.             }else{
  58.                 echo "Lista vasia!.";
  59.             }
  60.         }
  61.     ?>
  62. </body>
  63. </html>
Add Comment
Please, Sign In to add comment