Advertisement
RieqyNS13

Solved

Oct 20th, 2012
166
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.75 KB | None | 0 0
  1. <?php
  2. /*Solved !
  3. Thanks to RefnaLdi Hakim*/
  4. if(isset($_POST['btnSmt'])){
  5. $list = @trim($_POST['txValue']);
  6. $exp = explode("\n", $list);
  7. $result = null;
  8. for($i=0; $i<count($exp); $i++){
  9. $preg = preg_replace("#\n|\r|\r\n#", '', $exp[$i]);
  10. $result.= "Start ".$preg." Finish"."\n";}
  11. }else{
  12. $result = null;
  13. $list = null;
  14. }
  15. ?>
  16. <html>
  17. <form method=POST action="<?php $_SERVER['PHP_SELF']; ?>">
  18. <textarea cols="50" rows="10" name="txValue"><?php echo $list; ?></textarea><br>
  19. <input type="submit" name="btnSmt">
  20. </form>
  21. <textarea cols="50" rows="10" name="txResult" readonly><?php echo $result; ?></textarea><br>
  22. </html>
  23. <!--
  24. - $preg = str_replace(array("\n","\r","\r\n"), '', $exp[$i]);
  25. - $preg = preg_replace("#\n|\r|\r\n#", '', $exp[$i]);
  26. --!>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement