In PHP, what would be the cleanest way to get the parent directory of the current running script relative to the www root? Assume I have:
$_
I Hope this will help you.
echo getcwd().''; // getcwd() will return current working directory echo dirname(getcwd(),1).''; echo dirname(getcwd(),2).''; echo dirname(getcwd(),3).'';
Output :
C:\wamp64\www\public_html\step C:\wamp64\www\public_html C:\wamp64\www C:\wamp64