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
Why not do it in the simple way:
dirname(__FILE__); //Current working directory dirname(dirname(__FILE__)); //Get path to current working directory
And then finally
$include_path = $dir_path . 'file_to_include.php'; include $include_path;