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 368 views
1 answer 282 views
1 answer 298 views
2 answers 385 views
1 answer 262 views
2 answers 370 views
370 views asked Jun 14, 2016 by avibootz
...