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 277 views
1 answer 294 views
2 answers 380 views
1 answer 257 views
2 answers 363 views
363 views asked Jun 14, 2016 by avibootz
...