How to get the parent directory of running script in PHP

1 Answer

0 votes
echo realpath(dirname(__FILE__));

/*
run:

C:\xampp\htdocs\allonpage\includes\

*/

 



answered Oct 31, 2018 by avibootz
edited Jul 16, 2020 by avibootz

Related questions

2 answers 255 views
255 views asked Jun 14, 2016 by avibootz
3 answers 450 views
1 answer 126 views
126 views asked Aug 6, 2023 by avibootz
2 answers 303 views
1 answer 217 views
...