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. Quote 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']); Quote 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__); Quote 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 Quote Link to comment https://forums.phpfreaks.com/topic/190695-finding-current-directory/#findComment-1005671 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.