Forum Moderators: coopster

Message Too Old, No Replies

Make a multi-line HTML file into one line

         

wfernley

4:06 pm on Nov 8, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



If I was to have a HTML document that had multi lines like this:

<html>
<body>
test<br>
<br>
</body>
</html>

How Could I turn it into this:

<html><body>test<br><br></body></html>

I tired doing a str_replace with "/n" to "" but that didn;t work.

Does anyone know how I can make an html document a single line?

Thanks in advance for your help :)

Wes

sned

4:51 pm on Nov 8, 2005 (gmt 0)

10+ Year Member



You could try replacing "\r\n" with "" -- that's a line feed and a carriage return.

-sned

jatar_k

4:52 pm on Nov 8, 2005 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



for one your /n should be \n
you should also add a replace for \r

if you do both it should work

musicales

4:53 pm on Nov 8, 2005 (gmt 0)

10+ Year Member



in asp you do that by replacing the character code. I expect there's a similar function like replace(char(10),"") etc