Friday 15 April 2011

php - removing \n from a string retrieved from DB -


I have tried a lot with no luck yet:

I used TinyMCE I'm running through mysql_real_escape_string (), then add it to the database.

An example of a string stored in DB is:

& lt; P & gt; It would be nice to be able to put it into 2 categories .... and gt; & Lt; P & gt; To think something. & Lt; / P & gt;

I receive problems after I recover the data. I can not remove the string = database entry listed above

  $ string = substr ($ item ['body'], 0) I \ n  

120). "..."; $ Item ['body'] = nl2br (stripslash (str_replace ("\ n", "

Here is the picture of the output.

Enter image details here

I just want to be normal HTML If possible, I would like to convert it all to one line, instead the section should be enlarged, it is considered a summary of one's posts, so it does not mean the meaning of a new row, making the summary field larger for 1 word it happens!

= "post-text" itemprop = "text">

Is this a "\ n" literal "\" followed by "n"? If this is the case then try:

  $ item ['bodysum'] = nl2br (str_replace ("\\ n", "


No comments:

Post a Comment