I want to include my PHP file googleanayltics.php
on every page on my webserver that is a .php or .html document
I would like to know:<
Here's what you could do accomplish what you actually want.
auto_prepend_file
and auto_append_file
. prepend.php
tag
return str_replace('', $fileContents . '', $buffer);
// insert $fileContents right AFTER tag
// return str_replace('', . '' . $fileContents , $buffer);
}
ob_start("callback");
?>
append.php
This relies on output buffering and is relatively expensive. You might also run into problems if your scripts also use output buffering.
So my best advice is to design your scripts in a way that the a layout is used for every page and you can easily change what's included in your pages by just changing the layout.