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)文章
使用php將某個(gè)目錄下面的所有文件羅列出來(lái)的方法詳解
本篇文章是對(duì)使用php將某個(gè)目錄下面的所有文件羅列出來(lái)的方法進(jìn)行了詳細(xì)的分析介紹,需要的朋友參考下2013-06-06
PHP應(yīng)用代碼復(fù)雜度檢測(cè)使用方法
這篇文章主要為大家介紹了PHP應(yīng)用代碼復(fù)雜度檢測(cè)使用方法詳解,有需要的朋友可以借鑒參考下,希望能夠有所幫助,祝大家多多進(jìn)步,早日升職加薪2023-06-06
php 中獎(jiǎng)概率算法實(shí)現(xiàn)代碼
這篇文章主要介紹了php 中獎(jiǎng)概率算法,需要的朋友可以參考下2017-01-01
PHP簡(jiǎn)單實(shí)現(xiàn)正則匹配省市區(qū)的方法
這篇文章主要介紹了PHP簡(jiǎn)單實(shí)現(xiàn)正則匹配省市區(qū)的方法,涉及php正則匹配、判斷、運(yùn)算等相關(guān)操作技巧,需要的朋友可以參考下2018-04-04
PHP手機(jī)號(hào)碼及郵箱正則表達(dá)式實(shí)例解析
這篇文章主要介紹了PHP手機(jī)號(hào)碼及郵箱正則表達(dá)式實(shí)例解析,文中通過(guò)示例代碼介紹的非常詳細(xì),對(duì)大家的學(xué)習(xí)或者工作具有一定的參考學(xué)習(xí)價(jià)值,需要的朋友可以參考下2020-07-07

