erme Posted February 16, 2010 Share Posted February 16, 2010 Hi What's the best way to trim an entire file so the source code (html) is on one line? Link to comment https://forums.phpfreaks.com/topic/192251-php-trim-to-save-on-file-size/ Share on other sites More sharing options...
freakstyle Posted February 17, 2010 Share Posted February 17, 2010 if your html file(s) are large enough to have line space effect the download time then you could just replace all the line breaks with nothing, you could also write the html in one line too i suppose. You could get the file contents using php and replace the line breaks on the fly. You could look into adding gzip compression at the server level too. Or look elsewhere for increased performance of your site. removing the white space seems to be more of an odd solution if your application is having performance issues. What's the full story here, might help to know the why so we can tell ya the how. good luck Link to comment https://forums.phpfreaks.com/topic/192251-php-trim-to-save-on-file-size/#findComment-1013471 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.