Johnny2 Posted March 27, 2013 Report Share Posted March 27, 2013 (edited) I am trying to copy a bunch of text which consists of several different paragraphs (with empty space in between them). Then I would like to paste this text into a form's textarea field. When I submit the form I would like to clean the information with something like the preg_replace below. $cleaned_info = preg_replace('#[^A-Za-z0-9)(,\'\.\-!?$" "" "]#i', '', $_POST['info']); How do I preserve the empty lines between paragraphs (which I'm assuming are hard-returns or whatever)? Adding \n to the things which I would like to preserve didn't work. Edited March 27, 2013 by Johnny2 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.