My PHP code:
include "something.php"
$mysite = writeContent();
//footer.php
ob_start();
echo "<script...all my javascript here...</script>";
$object = ob_get_contents();
ob_end_clean();
$search = array("\n","\r");
$replace = array("","");
$object = str_replace($search, $replace, $object);
echo $object;
then my JavaScript is malformed and doesn't work.
I know I can use gzip
to increase the speed (thats not what I'm asking) but what I really want is to remove the extra space from the code.