Issue
echo __DIR__;
" How to get document root path in PHP from any subdirectory using command line?
my directory structure--
/dinesh
/data
/asset
Suppose my root directry is /dinesh
and currently my script in asset but I require document root path till /dinesh only
by using command line php CLI
How will I get this?
I have tried DIR and FILE but that give path till asset and one more thing that dinesh is my local root folder name that is changeable when I move my code to other server"
Solution
echo($_SERVER["PWD"]); its working
Answered By - Dinesh Ghule Answer Checked By - Mildred Charles (PHPFixing Admin)
0 Comments:
Post a Comment
Note: Only a member of this blog may post a comment.