In Java, you can specify a class as a ServletFilter and map it in a way that any resource requested on your server would first run your ServletFilter where you can run any code you want and even modify the request/response.
I need something like this for PHP. Is there any equivalent?
I tried the prepend/append php value but this does not work for anything besides php files. For example I need to run this code when a user requests a jpg file from my Apache server, but with the prepend php value it ends up adding the code to the jpg and thus making it not render properly.
I need a Java ServletFilter equivalent in PHP
Moderator: General Moderators