file_get_contents("php://input", "r")實(shí)例介紹
更新時(shí)間:2013年07月01日 09:40:33 作者:
本篇文章是對(duì)file_get_contents("php://input", "r")的實(shí)例進(jìn)行了詳細(xì)的分析介紹,需要的朋友參考下
解釋不清,直接上例子
index.html
<form action="action.php" method="post" >
<input type="text" name="userName" id="userName" /><br/>
<input type="text" name="userPass" id="userPass" /><br/>
<input type="submit" value="ok" />
</form>
action.php
<?php
$raw_post_data = file_get_contents('php://input', 'r');
echo "-------\$_POST------------------<br/>";
echo var_dump($_POST) . "<br/>";
echo "-------php://input-------------<br/>";
echo $raw_post_data . "<br/>";
?>
index.html
復(fù)制代碼 代碼如下:
<form action="action.php" method="post" >
<input type="text" name="userName" id="userName" /><br/>
<input type="text" name="userPass" id="userPass" /><br/>
<input type="submit" value="ok" />
</form>
action.php
復(fù)制代碼 代碼如下:
<?php
$raw_post_data = file_get_contents('php://input', 'r');
echo "-------\$_POST------------------<br/>";
echo var_dump($_POST) . "<br/>";
echo "-------php://input-------------<br/>";
echo $raw_post_data . "<br/>";
?>
您可能感興趣的文章:
- PHP-CGI進(jìn)程CPU 100% 與 file_get_contents 函數(shù)的關(guān)系分析
- 深入php函數(shù)file_get_contents超時(shí)處理的方法詳解
- 解析PHP中的file_get_contents獲取遠(yuǎn)程頁(yè)面亂碼的問(wèn)題
- php讀取本地文件常用函數(shù)(fopen與file_get_contents)
- PHP file_get_contents設(shè)置超時(shí)處理方法
- php 使用file_get_contents讀取大文件的方法
- PHP使用fopen與file_get_contents讀取文件實(shí)例分享
相關(guān)文章
探討多鍵值cookie(php中cookie存取數(shù)組)的詳解
本篇文章是對(duì)多鍵值cookie(php中cookie存取數(shù)組)進(jìn)行了詳細(xì)的分析介紹,需要的朋友參考下2013-06-06PHP實(shí)現(xiàn)創(chuàng)建一個(gè)RPC服務(wù)操作示例
這篇文章主要介紹了PHP實(shí)現(xiàn)創(chuàng)建一個(gè)RPC服務(wù)操作,結(jié)合實(shí)例形式分析了PHP基于socket擴(kuò)展通信實(shí)現(xiàn)的RPC遠(yuǎn)程調(diào)用相關(guān)操作技巧,需要的朋友可以參考下2020-02-02過(guò)濾掉PHP數(shù)組中的重復(fù)值的實(shí)現(xiàn)代碼
去除一個(gè)數(shù)組中的重復(fù)值,可以使用foreach方法,也可以使用array_unique方法,下面的代碼兩種方法都使用了。2011-07-07php使用function_exists判斷函數(shù)可用的方法
這篇文章主要介紹了php使用function_exists判斷函數(shù)可用的方法,通過(guò)一個(gè)圖像處理函數(shù)中使用function_exists函數(shù)判斷并輸出來(lái)實(shí)現(xiàn)函數(shù)存在判斷與流程靈活控制的功能,具有很好的借鑒價(jià)值,需要的朋友可以參考下2014-11-11