卷曲安装

时间:2015-06-25 14:57:00

标签: php curl

我发布了一个问题,有人告诉我用户卷曲功能。我仔细挖掘并迷惑了。 我是否必须安装curl然后我可以使用它我的curl函数来传递值是什么?

post_to_url("https://www.msgapp.com/RESTPostForm.aspx", $data); 
$data= array(
                "Customer"=> "ch",
                "cke"=>"1",
                "ownerid"=> "6",
                "overwrite"=>"0",
                "TriggerID"=> "1950",
                "PushExternal"=> "1",
                "City"=> "London",
                "FirstName"=>"Test",
                "LastName"=>"User",
                "Email"=> "jibran@abc.com"
                    );      
function post_to_url($url, $data) {
   $fields = '';
   foreach($data as $key => $value) { 
      $fields .= $key . '=' . $value . '&'; 
   }
   rtrim($fields, '&');

   $post = curl_init();

   curl_setopt($post, CURLOPT_URL, $url);
   curl_setopt($post, CURLOPT_POST, count($data));
   curl_setopt($post, CURLOPT_POSTFIELDS, $fields);
   curl_setopt($post, CURLOPT_RETURNTRANSFER, 1);

   $result = curl_exec($post);

   curl_close($post);
}

1 个答案:

答案 0 :(得分:1)

search php.ini file for

‘;extension=php_curl.dll’

and remove the semi-colon in front, then you can run curl function