Home >Backend Development >PHP Tutorial >Analysis of the specific meaning of PHP external variables_PHP tutorial

Analysis of the specific meaning of PHP external variables_PHP tutorial

WBOY
WBOYOriginal
2016-07-15 13:31:36840browse

For newcomers to the PHP language, their understanding of variables is still relatively vague. I hope that through this article you can have a detailed understanding of PHP external variables and deepen your understanding of the PHP language.

PHP external variable example code:

  1. < form action=”one.php”
  2. method=”get”>
  3. User:< input type=”text”
  4. name=”username”>< br>
  5. Password< input type=”password”
  6. name=”pass”>< ; br>
  7. < input type=”submit” values ​​“OK”>
  8. < /form>

<ol class="dp-xml"><li class="alt"><span><span class="tag"><</span><span> ?php  </span></span></li><li><span>Echo &ldquo;user&rdquo;;  </span></li><li class="alt"><span>Echo $_get[&ldquo;username&rdquo;];  </span></li><li><span class="tag">?></span><span> </span></span></li></ol>

$_get can only accept the data sent back by the get method

$_post can only accept the data sent back by the post method

$ _request can accept data sent back by all methods

or it can be passed directly. PHP external variables are separated by &.

hello This is equivalent to the get method passing.

It is best to use $_get or $_request to receive.

There are other PHP external variables

$_files

$_cookie

$_session

The PHP external variables passed can be used directly on this page.


www.bkjia.comtruehttp: //www.bkjia.com/PHPjc/446201.htmlTechArticleFor newcomers to the PHP language, the understanding of variables is still relatively vague. I hope that through this article you can have a detailed understanding of PHP external variables and deepen your understanding of the PHP language...
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