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 365 views
1 answer 276 views
1 answer 294 views
2 answers 379 views
1 answer 255 views
2 answers 362 views
362 views asked Jun 14, 2016 by avibootz
...