I am adding some include("file.php"); to several php pages.
Is there any way to be sure the include is added to every PHP page I create so I don't need to manually add those lines of code and also to prevent human error. If it is not possible to automatically do this, what would be the best way to achieve this.
I need to do this so I can do something like checking it the user is already authenticated then continue if not then redirect to the login page.
__autoloadfeature in PHP: php.net/manual/en/language.oop5.autoload.php