How to get the absolute path to the public_html folder?

后端 未结 11 1361
离开以前
离开以前 2020-12-08 14:25
$_SERVER[\'DOCUMENT_ROOT\']

returns

/usr/local/apache/htdocs/

is there a way to get

/home/us         


        
11条回答
  •  一向
    一向 (楼主)
    2020-12-08 15:05

    Out of curiosity, why don't you just use the url for the said folder?

    http://www.mysite.com/images

    Assuming that the folder never changes location, that would be the easiest way to do it.

提交回复
热议问题