Customize Your Own PHP Curl Class

A simple php curl class include some default setting that always used.

Load

1
composer require lizus/php-curl

Constant

1
2
3
define('PHPCURL_UA', 'your ua');//custom useragent

define('PHPCURL_COOKIE', 'your cookie');//custom cookie

Sample

1
2
3
4
5
use \Lizus\PHPCurl\PHPCurl;

$curl=new PHPCurl();
$data=$curl->get('some url');
var_dump($data);