Home > Backend Development > PHP Tutorial > PHP Curl HttpRPC

PHP Curl HttpRPC

WBOY
Release: 2016-06-23 13:49:23
Original
1576 people have browsed it

    /*       * @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; }
Copy after login

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template