<?php
$data = array ( "name" => 'test_name' , "content" => 'test_con' );
$data = http_build_query( $data );
$opts = array (
'http' => array (
'method' => "POST" ,
'header' => "Content-type: application/x-www-form-urlencoded\r\n" .
"Content-length:" . strlen ( $data ). "\r\n" .
"Cookie: foo=bar\r\n" .
"\r\n" ,
'content' => $data ,
)
);
$cxContext = stream_context_create( $opts );
$sFile = file_get_contents ( "http://127.0.0.1/reponse.php" , false, $cxContext );
echo $sFile ;
?>
// 结果
string(132) "array(2) { ["content"]=> string(8) "test_con" ["name"]=> string(9) "test_name" } array(1) { ["foo"]=> string(3) "bar" } "
最后修改:2022 年 07 月 11 日
© 允许规范转载
17 条评论
真棒!
博主太厉害了!
博主太厉害了!
博主太厉害了!
真好呢
畅玩147刀塔传奇私服,尽享超值福利盛宴!:https://501h.com/yuanshi/2024-07-31/24638.html
传奇私服中物品价格如何设定才合理?:https://501h.com/fugu/2024-09-08/33800.html
解决玩传奇私服装备不显示问题,畅快游戏新体验!:https://501h.com/jinbi/20160.html
123123
lykep.com域名卖吗 卖的话加我微信1375599165
lykep.com域名卖吗 卖的话加我微信13755991653