Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- if (isset($_POST['myText'])&&!empty($_POST['myText'])&&isset($_POST['strFind'])&&!empty($_POST['strFind'])&&isset($_POST['strReplace'])&&!empty($_POST['strReplace'])) {
- $myText=$_POST['myText'];
- $strFind=$_POST['strFind'];
- $strReplace=$_POST['strReplace'];
- $offset=0;
- $myText = str_replace($strFind, $strReplace, $myText);
- echo $myText;
- }
- ?>
- <hr>
- <form action="index.php" method="POST">
- <textarea name="myText" rows="6" cols="30"></textarea><br><br>
- <strong>String to find</strong><br>
- <input type="text" name="strFind"><br><br>
- <strong>String to replace</strong><br>
- <input type="text" name="strReplace"><br>
- <input type="submit" name="submit">
- </form>
Add Comment
Please, Sign In to add comment