新产品火狐
This commit is contained in:
@@ -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) );
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user