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 233 views
233 views asked Jun 14, 2016 by avibootz
3 answers 423 views
1 answer 108 views
108 views asked Aug 6, 2023 by avibootz
2 answers 272 views
1 answer 202 views
...