Jump to content

Recommended Posts

Posted (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 by Johnny2

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...