php中的 file_get_contents(‘php://input’)
今天用CI框架整合微信发现了一个没见过的 file_get_contents('php://input'); 这个家伙是干嘛用的,然后自己直接写了验证的代码。好吧 废话不多说直接看下面的代码。
<?php
$raw_post_data = file_get_contents('php://input');
echo "-------\$_POST------------------<br/>";
echo var_dump($_POST) . "<br/>";
echo "-------php://input-------------<br/>";
echo $raw_post_data . "<br/>";
?>
<form action="a.php" method="post" >
<input type="text" value="zhangsan" name="name"/></br>
<input type="password" value="zhangsan" name="pwd"/></br>
<input type="submit" value="提交" /></br>
</form>
--------------------------------------
提交后显示的结果为:
-------$_POST------------------
array() { ["name"]=> string() "zhangsan" ["pwd"]=> string() "zhangsan" }
-------php://input-------------
name=zhangsan&pwd=zhangsan
php中的 file_get_contents(‘php://input’)的更多相关文章
- php中的 file_get_contents(‘php://input’)用法
php中的 file_get_contents('php://input')用法: file_get_contents 获取php页面中input内容的值: eg: php: 页面提交了usernam ...
- **对比$_POST、$GLOBALS['HTTP_RAW_POST_DATA']和file_get_contents('php://input')
最近在开发微信接口,又学到了一些新的技术点,今天就把学到的关于接收数据的技术点给简单的罗列下. public function __construct($token, $wxuser = ''){ $ ...
- (转载)file_get_contents("php://input")
(转载)http://taoshi.blog.51cto.com/1724747/1165499 $data = file_get_contents("php://input"); ...
- file_get_contents("php://input")的使用方法
$data = file_get_contents("php://input"); //input 是个可以访问请求的原始数据的只读流. POST 请求的情况下,最好使用 php: ...
- file_get_contents("php://input")的用法
$data = file_get_contents("php://input"); php://input 是个可以访问请求的原始数据的只读流. POST 请求的情况下,最好使用 ...
- 【转】file_get_contents("php://input")的使用方法
$data = file_get_contents("php://input"); php://input 是个可以访问请求的原始数据的只读流. POST 请求的情况下,最好 ...
- file_get_contents("php://input")
$data = file_get_contents("php://input"); php://input 是个可以访问请求的原始数据的只读流. POST 请求的情况下,最 ...
- file_get_contents('php://input') 数据如何转换成数组
前台表单页:demo01.html 后台:demo01.php 输出结果: 备注:若前台通过Ajax的post提交过来的是json数据,需要对json数据进行解析:$data = json_decod ...
- PHP中fopen,file_get_contents,curl函数的区别
PHP中fopen,file_get_contents,curl函数的区别 1.fopen/file_get_contents每次请求都做DNS查询,并不对DNS的信息进行缓存,而curl会对DNS的 ...
随机推荐
- Apache高级配置
认证授权和访问控制 ip访问控制: 目录控制语句以开头:以结束. AllowOverride None:不允许覆盖,即不允许从根目录向子目录覆盖.即默认情况下拒绝从根目录下向子目录访 问,如果要看根目 ...
- 关联规则( Association Rules)之频繁模式树(FP-Tree)
Frequent Pattern Tree(频繁模式树)是Jiawei Han在2004年的文章<Mining Frequent Patterns without Candidate Gener ...
- 用MyEclipse10.0远程连接Mysql数据库服务器
说明:本文档所有的操作均在满足以下条件的情况下操作, A.远程Linux服务器已经安装好MySQL数据库 B.本地电脑可以ping通远程服务器 C.已经成功安装了Myeclipse 一.下载mysql ...
- Apache Drupal URL重写【转】
文章来源:http://www.cnblogs.com/ghj1976/archive/2010/07/19/1780844.html 在 drupal 跟目录下有个 .htaccess 文件, 这个 ...
- Android View Attributes
ImageView android:adjustViewBounds Set this to true if you want the ImageView to adjust its bounds ...
- 自制MVC框架基础插件介绍
本文介绍的基础插件不是实现BeforehandCommonAttribute或ProceedPlugin的postsharp插件,这些都是自定义的基础性的拦截,而且在项目中经常用到. 1). Comp ...
- python DataFrame获取行数、列数、索引及第几行第几列的值
print df.columns.size#列数 2 print df.iloc[:,0].size#行数 3 print df.ix[[0]].index.values[0]#索引值 0 print ...
- Groovy小结:java调用Groovy方法并传递参数
Groovy小结:java调用Groovy方法并传递参数 @(JAVA总结) 1. 场景描述 在网上查了资料发现,java有三种方式调用groovy脚本.但是真正在实际的服务器环境中,嵌入groovy ...
- 强大的响应式jQuery消息通知框和信息提示框插件
lobibox是一款功能很强大的jQuery消息通知框和信息提示框插件.这个插件分为两个部分:消息通知框和信息提示框.它能很好的结合Bootstrap使用. 信息提示框 lobibox的信息提示框能够 ...
- JQ集合
获取所有id以a开头的div$("div[id^='a']") $('div').last() $('#item1') <div id='select'>点击这里< ...