Reputation: 291
I am trying to get relative path of my project, but not exactly as required.
I have a directory structure like : '/opt/www/myproj/folder1/folder2/myfile.php'
So in myfile.php I am trying to get path till my project ie., /opt/www/myproj
I have tried differnt ways like using $_SERVER["DOCUMENT_ROOT"]
, dirname(__FILE__)
, basename(__FILE__)
etc.. but still no luck.
When I used $_SERVER["DOCUMENT_ROOT"]
, iam getting path till /opt/www/
Could anyone please tell me how can I achieve above..
Upvotes: 1
Views: 25