Is there a way to overload any given PHP function without doing a source edit/compile? In other words, is it possible to replace a function with your own instance of one in only a particular script.
Here's what I want to do:
replace the echo function with my own that will take the parameter, strip any redundant whitespaces, and spit out the output. This is reducing my page size by 1-3kb per page, but I don't want to have to go through and recode every echo to myEcho or whatever.
I want something that looks like this:
function echo($text) {
$b = preg_replace("/(\s\s)*/","",$b);
print $b;
}
Anyone know of a way to do it in PHP?