/**
* 模拟post请求
*/
public static function postHtml($Url, $PostArry){
if(!is_array($PostArry)){
throw new Exception("无法识别的数据类型【PostArry】");
}
$FormString = "<body onLoad=\"document.actform.submit()\">正在处理,请稍候.....................<form id=\"actform\" name=\"actform\" method=\"post\" action=\"" . $Url . "\">";
foreach($PostArry as $key => $value){
$FormString .="<input name=\"" . $key . "\" type=\"hidden\" value='" . $value . "'>\r\n";
}
$FormString .="</form></body>";
return $FormString;
}
PHP 中的CURL 模拟表单的post提交
<?php
$data = ['username'=>'小明','sex'=>'男'];
$headers = ar