Jump to content

Removing white spaces and line breaks


lokie538

Recommended Posts

Hi,

 

I have to find how to remove all the white spaces and line breaks so it is just a string. For instance the output should be "cooroy, cooroy mountain, lake mcdonald, tinbeerwah"

 

This is the output I have at the moment:

           
                    
                  
                  
                     
                           
                            COOROY,
                           
                  
                     
                           
                            COOROY MOUNTAIN,
                           
                  
                     
                           
                            LAKE MACDONALD,
                           
                  
                     
                           
                            TINBEERWAH
                           
                  
                  
                        

 

Ive tried to string replace " " with "" but there are still all the line breaks which I need to be removed.

 

There is probably a simplified way to do this? Any suggestion guys? Ive tried looking at nl2br( but that hasn't worked either.

Link to comment
https://forums.phpfreaks.com/topic/141211-removing-white-spaces-and-line-breaks/
Share on other sites

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.