I have a project. It has a large number of PHP files. Each of these files includes a standard header. They do not include a standard footer.
Now I want to do something just to the end of each page. I can go through each page and add the footer code, but I was wondering if there is an easier way (and I think I saw something like this before, although I could be wrong).
Is there a way to set the hook or trigger function, which will be executed at the end of the page, from the included PHP script header? I am thinking of something like set_error_handler , but to handle the page close event. Or like C atexit .
source share