I have an absolute path of a file, Is there a way to get the file absolute path
http://domainname/rootfolder/filename.php
and I wanna get s
Try $_SERVER['DOCUMENT_ROOT']. Assuming a URL like
$_SERVER['DOCUMENT_ROOT']
http://example.com/subfolder/somefile.html
and the file's actual location on the server being
/home/sites/example.com/html/subfolder/somefile.html ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^--- $_SERVER['DOCUMENT_ROOT']