I want to find a method to include some files based on the current file path.. for example:
I have \"website.com/templates/name1/index.php\", this \"index.php should be
I think you need to use __FILE__ (it has two underscores at the start and at the end of the name) and DIRECTORY_SEPARATOR constants for working with files based on the current file path.
For example:
Using DIRECTORY_SEPARATOR constant is more safe than using "/" (or "\") symbols, because Windows and *nix directory separators are different and your interpretator will use proper value on the different platforms.