Hi,
i wanted to replace the $ob_get_contents at the end of my script so there will be no newlines when you view the source (the complete source will be on about 5 lines so its harder to steal scripts and stuff).
I've used this script before on plain .html files to get rid of the newlines, but on my new site with mysql and php i wanted to do the same.
The old script:
$nonewlines = file ("bla.html");
while (current ($nonewlines)) {
echo ereg_replace("\n","",current $nonewlines)); next ($nonewlines);
}
In my new page I start with ob_start(); and at the end of the page I put these lines of code:
$Contents = ob_get_contents();
ob_end_clean();
$nonewlines = $Contents;
$nonewlines = str_replace ("\n", "", "$nonewlines");echo "$nonewlines";
exit;
The weird thing is that it doesnt work. The source is echo'd well, that works, but the str_replace doesnt work.
It also doesnt work when I use ereg_replace("\n","",current $nonewlines));
Can anyone help me with this?