Get Current Directory from PHP

written by Arief Bayu Purwanto on May 8, 2007 in Tips N Trick with 20 comments

Yes, I’m lazy because if I want to manual, I’ll find a method to find current directory instead of reinventing the wheel. Hehehe, so, here’s what I do to find current directory :

echo dirname(__FILE__);

Now, I have new post for my blog :D .

Update: As comments from readers, you can also use getcwd() to get equal result.