Get Current Script Path in PHP

Posted on August 26, 2019 at 12:09 pm

Snippet to get current script path in PHP:

echo realpath(dirname(__FILE__));

It will output the current PHP script path, i.e:

/var/www/domain.com/htdocs/libs

Receive updates via email

Other Posts

Updated Posts