Get Absolute path iusing PHP

by Subramanian 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);
1202
like
0
dislike
0
mail
flag

You must LOGIN to add comments