Johnny2 Posted March 27, 2013 Report 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
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now