How to check the last modification time of the PHP file, not writing the path to it?

All kind time of day!
The problem is that I need to check the file page.php at the time of last modification (file check is made from the same file. That is, I need to file checked myself). All anything, but in order to do that, I need to set the path to this file. And so will have for each page to repeat this process.
I need to organize caching, to know which header in which case send.
Other way is not invented. Is there any way to write the path to each file every time, and make a PHP file to insert a path to itself automatically?
June 5th 19 at 21:44
2 answers
June 5th 19 at 21:46
Solution
What is the worst you describe...
php.net/manual/ru/language.constants.predefined.php
Huh, maybe terrible, but the only thing that came up. The only thing I'm not good is invalidating the cache and PHP knowledge :) - eleanora10 commented on June 5th 19 at 21:49
just needs to be one entry point. 1 file accessed by the browser. And the display and logic should be separated from each other. - kenny commented on June 5th 19 at 21:52
that is, it would be correct to connect the file with the logic for the page? Type as include? - eleanora10 commented on June 5th 19 at 21:55
, Google about autoloading in PHP and about routing. - kenny commented on June 5th 19 at 21:58
, good read, thanks for the info! - eleanora10 commented on June 5th 19 at 22:01
June 5th 19 at 21:48
Solution
The constant __FILE__ to help you

Find more questions by tags PHP