phppaper Posted March 29, 2008 Share Posted March 29, 2008 I wish to know how to write a directory path 2 level above the file. for example I am inside the directory /levelone/leveltwo/levelthree I want to write a php file point to a file in "levelone" directory, how to write the path to point to a directory 2 level above the file?? Link to comment https://forums.phpfreaks.com/topic/98435-path-of-a-directory-2-level-above/ Share on other sites More sharing options...
beebum Posted March 29, 2008 Share Posted March 29, 2008 ../.. Link to comment https://forums.phpfreaks.com/topic/98435-path-of-a-directory-2-level-above/#findComment-503770 Share on other sites More sharing options...
keeB Posted March 29, 2008 Share Posted March 29, 2008 $above = dirname(__FILE__) . "/../../myfile.php"; Link to comment https://forums.phpfreaks.com/topic/98435-path-of-a-directory-2-level-above/#findComment-503774 Share on other sites More sharing options...
mkoga Posted March 29, 2008 Share Posted March 29, 2008 not the prettiest, but: $file = dirname(dirname(dirname(__FILE__))) . "myfile.php"; Link to comment https://forums.phpfreaks.com/topic/98435-path-of-a-directory-2-level-above/#findComment-503831 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.