Jump to content

Remove New Lines that aren't \n


jpt62089

Recommended Posts

I am trying to grab information from a website via PHP and when I do so there are line breaks in the source of the page. I've tried to replace \n and it didn't work.  Is there a way to remove "phantom" line breaks?  Did that even make sense? haha

 

It's like viewing the source of a page.  You see that there are new lines, but no function telling it to do so.

Link to comment
https://forums.phpfreaks.com/topic/130319-remove-new-lines-that-arent-n/
Share on other sites

Pardon? Not fully understanding you.

 

Are you saying your newlines are not being displayed? If so you'll need to convert newlines to <br /> in order for then to display on your page. PHP has a built in function which handles this for you called nl2br()

 

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.