How to get the path to the directory where the current file is located in PHP

2 Answers

0 votes
echo __DIR__;

  
/*
run:
   
C:\xampp\htdocs\answersmind.com 
   
*/

 



answered Oct 9, 2017 by avibootz
0 votes
echo dirname(__FILE__);

  
/*
run:
   
C:\xampp\htdocs\answersmind.com 
   
*/

 



answered Oct 9, 2017 by avibootz

Related questions

1 answer 239 views
1 answer 178 views
1 answer 190 views
2 answers 250 views
1 answer 166 views
2 answers 233 views
233 views asked Jun 14, 2016 by avibootz
...