gwolgamott Posted February 2, 2010 Share Posted February 2, 2010 OK stupid question time.... How do I find what directory I am in... How can I do a test echo just to display a current directory.... i.e. can we say my main program is running root/bob/temp/don how do I get that to display that? For scope reason when reusing O.O. functions/programs/whatever.... so I can pass that variable to said Object I mean. Link to comment https://forums.phpfreaks.com/topic/190695-finding-current-directory/ Share on other sites More sharing options...
mattal999 Posted February 2, 2010 Share Posted February 2, 2010 dirname($_SERVER['PHP_SELF']); Link to comment https://forums.phpfreaks.com/topic/190695-finding-current-directory/#findComment-1005668 Share on other sites More sharing options...
wildteen88 Posted February 2, 2010 Share Posted February 2, 2010 Use cwd, alternatively you could do echo dirname(__FILE__); Link to comment https://forums.phpfreaks.com/topic/190695-finding-current-directory/#findComment-1005669 Share on other sites More sharing options...
gwolgamott Posted February 2, 2010 Author Share Posted February 2, 2010 Thank-you Link to comment https://forums.phpfreaks.com/topic/190695-finding-current-directory/#findComment-1005671 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.