Replace breaking lines (\n) in text or textarea input using php - How to
This script helps us to replace new lines (breaking lines - \n) from an text input or textarea input with the Html character <br> used for break lines.
Suplimentar explanation:
When a user write a text into a text field or textarea field and pres the enter key resulting a breaking line.
example:
//===============
$com='This is posted content from a simple textarea or input text into a html form \n This is breaking line';
$com=eregi_replace(chr(13),"<br>",$com);
//===============
The output is:
This is posted content from a simple textarea or input text into a html form <br> This is breaking line
or
This is posted content from a simple textarea or input text into a html form
This is breaking line