Home  >  Article  >  Backend Development  >  The php script path is unclear. The php script is unclear_PHP tutorial

The php script path is unclear. The php script is unclear_PHP tutorial

WBOY
WBOYOriginal
2016-07-13 16:54:03732browse

Stupidly confused about the php script path, stupidly confused about the php script

I won’t go into small talk, but I’ll just ask today’s question. To be precise, to many A similar distinction between global variables and constants related to the current script information.

Paste the code first:

<?<span>php
</span><span>echo</span> <span>$_SERVER</span>['PHP_SELF'<span>];
</span><span>echo</span> "<hr/>"<span>;
</span><span>echo</span> <span>__FILE__</span><span>;
</span><span>echo</span> "<hr/>"<span>;
</span><span>echo</span> <span>$_SERVER</span>['SCRIPT_FILENAME'<span>];
</span><span>echo</span> "<hr/>"<span>;
</span><span>echo</span> <span>$_SERVER</span>['REMOTE_ADDR'<span>];
</span><span>echo</span> "<hr/>"<span>;
</span><span>echo</span> <span>$_SERVER</span>['QUERY_STRING'<span>];
</span><span>echo</span> "<hr/>";

The address in the browser is http://localhost/test/test4.php?a=3 localhost is the root directory.

Looking at it now, it turns out that the monk Zhang Er was really confused after taking a closer look.

Posting the results, no need to explain much, I believe many people will understand it at a glance.

www.bkjia.comtruehttp: //www.bkjia.com/PHPjc/1051886.htmlTechArticleStupidly unclear about the php script path, stupidly unclear about the php script, so I won’t go into gossip, or just go directly Ask today's question, to be precise, multiple similar questions about the current script information...
Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn