Home > php教程 > php手册 > PHP外部变量的具体含义解析

PHP外部变量的具体含义解析

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
Release: 2016-06-13 11:08:35
Original
1068 people have browsed it

对于初学PHP语言的新手来说,对于变量的理解还是比较模糊。希望大家能够通过这篇文章对PHP外部变量有一个详细的了解,加深对PHP语言的理解。

PHP外部变量示例代码:

  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> ?php  </span></span></span></li>
<li><span>Echo “user”;  </span></li>
<li class="alt"><span>Echo $_get[“username”];  </span></li>
<li>
<span class="tag">?></span><span> </span>
</li>
</ol>
Copy after login

$_get 只能接受get方法发送回来的数据

$_post 只能接受post方法发送回来的数据

$_request 可以接受所有方法发送回来的数据

也可以直接传递,PHP外部变量之间用&隔开。

hello 这种相当于get方法传递。

最好用$_get 或者$_request接收。

还有其他的PHP外部变量

$_files

$_cookie

$_session

传递过来的PHP外部变量可以直接在本页面用。
 


Statement of this Website
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
Latest Issues
php data acquisition?
From 1970-01-01 08:00:00
0
0
0
PHP extension intl
From 1970-01-01 08:00:00
0
0
0
How to learn php well
From 1970-01-01 08:00:00
0
0
0
Popular Recommendations
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template