码迷,mamicode.com
首页 > Web开发 > 详细

PHP Curl HttpRPC

时间:2014-09-16 17:26:40      阅读:204      评论:0      收藏:0      [点我收藏+]

标签:php   curl   

    /*  
     * @brief 执行URI
     * @param $uri
     * @return json
     * @author fox
     **/
    private function _getHttpResponseGET($uri){
        $curl = curl_init($uri);//initiate
        curl_setopt($curl, CURLOPT_URL, $uri);
        curl_setopt($curl,CURLOPT_HEADER,0);//filter http header
        curl_setopt($curl,CURLOPT_RETURNTRANSFER,1);//show the output
        curl_setopt($curl,CURLOPT_SSL_VERIFYPEER,true);//ssl certficate|authentication
        curl_setopt($curl,CURLOPT_SSL_VERIFYHOST,2); //strict authentication
        $content = curl_exec($curl);//execute and obtain the content
        curl_close($curl);
        return $content;
 }

PHP Curl HttpRPC

标签:php   curl   

原文地址:http://blog.csdn.net/arcticfoxhan/article/details/39319559

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!