新产品火狐

This commit is contained in:
“wanyongkang”
2021-04-26 18:50:06 +08:00
parent 8efb5f9c5a
commit 33ff11d5ff
5 changed files with 214 additions and 18 deletions

View File

@@ -148,7 +148,7 @@ function realname($data){
* @param int $ipost [是否采用POST形式]
* @return string
*/
function linkcurl($url,$method,$params=false,$header=[]){
function linkcurl($url,$method,$params=[],$header=[]){
$httpInfo = array();
$ch = curl_init();
@@ -157,6 +157,7 @@ function linkcurl($url,$method,$params=false,$header=[]){
curl_setopt($ch, CURLOPT_HTTPHEADER, $header);
curl_setopt($ch, CURLOPT_FAILONERROR, false);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_HEADER, 1); //是否显示头信息
if (1 == strpos("$".$url, "https://"))
{
@@ -169,7 +170,7 @@ function linkcurl($url,$method,$params=false,$header=[]){
if($method == "POST" ){
curl_setopt( $ch , CURLOPT_POST , true );
curl_setopt( $ch , CURLOPT_POSTFIELDS, json_encode($params) );
curl_setopt( $ch , CURLOPT_POSTFIELDS, $params );
}else if($params){
curl_setopt( $ch , CURLOPT_URL , $url.'?'.http_build_query($params) );
}