PHP code example of tp3 / curl

1. Go to this page and download the library: Download tp3/curl library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

tp3 / curl example snippets


$url = "http://www.baidu.com";	//访问URL
$referer = '';		//来源
$curl = new Curl();
$info = $curl->get($url,$referer);
echo $info;
exit();

use \juju\curl\Curl;

$url = "http://www.baidu.com";
$data['search'] = '123';

$curl = new Curl();
$info = $curl->post($url,$data);
echo $info;
exit();