I know PHP > 5.3 added the Magic constants : __DIR__ to get the father dir path,
But how can I get the grandfather dir path in a smarter way?
1.__DIR__.'/../'
2.dirname(__DIR__)
I know PHP > 5.3 added the Magic constants : __DIR__ to get the father dir path,
But how can I get the grandfather dir path in a smarter way?
1.__DIR__.'/../'
2.dirname(__DIR__)
Use the second parameter
levelsfor the dirname callHowever, it is not any better than what you already have. It's just smarter like you asked for :)