Guest User

Untitled

a guest
Jul 20th, 2018
82
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.67 KB | None | 0 0
  1. <?php
  2. if (isset($_POST['myText'])&&!empty($_POST['myText'])&&isset($_POST['strFind'])&&!empty($_POST['strFind'])&&isset($_POST['strReplace'])&&!empty($_POST['strReplace'])) {
  3.     $myText=$_POST['myText'];
  4.     $strFind=$_POST['strFind'];
  5.     $strReplace=$_POST['strReplace'];
  6.     $offset=0;
  7.     $myText = str_replace($strFind, $strReplace, $myText);
  8.     echo $myText;
  9. }
  10. ?>
  11. <hr>
  12. <form action="index.php" method="POST">
  13.     <textarea name="myText" rows="6" cols="30"></textarea><br><br>
  14.     <strong>String to find</strong><br>
  15.     <input type="text" name="strFind"><br><br>
  16.     <strong>String to replace</strong><br>
  17.     <input type="text" name="strReplace"><br>
  18.     <input type="submit" name="submit">
  19. </form>
Add Comment
Please, Sign In to add comment