Forum Moderators: phranque
When I run the same PHP code on my webhost (GoDaddy), every meta tag and link tag in the head section is on a new line. The webhost seems to be adding in extra returns into my HTML code.
I am aware that my webhost may be using a cache. Is it common for a cache or proxy server to do this?
Has anyone seen anything like this?
Extra spaces though, these do help in writing and organising (same way as returns do) to help break uip the page. Depending on how much white space you have, is it worth getting rid of it?
:)
To your original problem, you're saying the PHP is removing the space? Are you sure there's some regexp not working correctly?
What's the platform, Linux? If you do, say, a replace for \n, it may need a \r or zero or more: \n\r*. Newline characters are different on Linux than PC newlines.
Last, for others that may help, is this a shared hosting account, VPS, or dedicated? I've got a dedi plan with GD and have seen no such anomaly.
In regards to saving bandwidth, removing all returns, comments and spaces out of my html, css and js has saved me a lot of bandwidth. I like to leave a stack load of comments where I code and remove these comments by this method.
My 6 KB CSS file for example can be reduced down to 2 KB just by removing the comments and whitespace.