Thursday 15 April 2010

php - How to use nl2br to remove \n and add breaks -


There is a problem getting me nl2br to do everything I need to do .

Can anyone explain that nl2br is passed to \ n in JSON data by & lt; Br / & gt; In my PHP?

Here is the code:

  $ page = file_get_contents ('JSON_FEED_URL'); $ Page2 = nl2br ($ page);   

When I resonate $ page2 and look at the HTML page, it comes in the form of a large wall of text.

Try

  $ page = file_get_contents ('JSON_FEED_URL') ; $ Page2 = preg_replace ("/ \\ n / m", "

As stated, str_replace works even faster, but the number above the multipurpose brake.

No comments:

Post a Comment