Document Root PHP

后端 未结 4 961
时光说笑
时光说笑 2020-12-03 04:39

Just to confirm, is using:

$_SERVER[\"DOCUMENT_ROOT\"]

the same as using: /

in HTML.

Eg. If current document is:

         


        
4条回答
  •  臣服心动
    2020-12-03 05:12

    go with php
        
    go to with html

    Try this yourself and find that they are not exactly the same.

    $_SERVER['DOCUMENT_ROOT'] renders an actual file path (on my computer running as it's own server, C:/wamp/www/

    HTML's / renders the root of the server url, in my case, localhost/

    But C:/wamp/www/hello.html and localhost/hello.html are in fact the same file

提交回复
热议问题