Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- /**
- * Created by PhpStorm.
- * User: luckymancvp
- * Date: 3/7/17
- * Time: 11:38 PM
- */
- $mailInput = isset($_POST['mailInput']) ? $_POST['mailInput'] : '';
- $mails = array_unique(explode(PHP_EOL, trim($mailInput)));
- $type = isset($_POST['type']) ? $_POST['type'] : '';
- $res = array();
- if ($type)
- {
- $mailInput = "";
- foreach ($mails as $mail) {
- if (strpos($mail, $type) !== false)
- $res[] = $mail;
- else
- $mailInput .= $mail . PHP_EOL;
- }
- }
- $res = implode(PHP_EOL, $res);
- ?>
- <html>
- <body>
- <form method="post">
- <select name="type">
- <option value="@gmail.com">@gmail.com</option>
- <option value="comcast">comcast</option>
- <option value="sbcglobal">sbcglobal</option>
- <option value="@mail.com">@mail.com</option>
- <option value="@att">@att</option>
- </select>
- <br>
- <textarea name="mailInput" placeholder="Input" cols="50" rows="20"><?php echo $mailInput?></textarea>
- <br>
- <textarea name="res" placeholder="output" cols="50" rows="20"><?php echo $res?></textarea>
- <br>
- <input type="submit"/>
- </form>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement