Get Absolute path iusing PHP
by Subramanian[ Edit ] 2014-04-17 15:06:03
PHP to get Absolute Path:
$folder = dirname(__FILE__);
The above code return the current file directory path.
If you need the absolute path for the public_html then
$folder = dirname(__FILE__);
while (basename($folder) != 'public_html')
$folder = dirname($folder);