levi levi - 1 year ago 78
PHP Question

Get 2 levels up from dirname( __FILE__)

How can I return the pathname from the current file, only 2 directories up?

So if I my current file URL is returning


How can I return "theme/"

Currently I am using

return dirname(__FILE__)

Answer Source
return dirname(dirname(__FILE__));

Should return 2 directories up for the current file.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download