1. Go to this page and download the library: Download zhusaidong/curlite 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/ */
zhusaidong / curlite example snippets
composer
use zhusaidong\CurLite\Request,zhusaidong\CurLite\Curl;
$request = new Request('https://github.com/search');
$request->postFields = ['q'=>'php curl','type'=>''];
$request->referer = 'https://github.com/';
$cl = new Curl($request);
$response = $cl->getResponse();
//if curl successed, the `$response->error` will equal `FALSE`.
if($response->error === FALSE)
{
echo $response->body;
}
else
{
echo 'error:'.$response->error;
}