PHP code example of kenvix / curl

1. Go to this page and download the library: Download kenvix/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/ */

    

kenvix / curl example snippets


$curl = new \Kenvix\curl\curl("https://bing.com/");
$curl->get(); //string response

\Kenvix\curl\curl::xget("https://bing.com/");

echo new \Kenvix\curl\curl("https://bing.com/"); //Will always print a description

$curl = new \Kenvix\curl\curl("https://bing.com/");
$curl->post([  //something to post
    'a' => 'foo',
    'b' => 'excited'
]); //string response

$curl = new \Kenvix\curl\curl("https://www.bing.com/");
$curl->head(); //array response

$curl = new \Kenvix\curl\curl("https://www.bing.com/");
$curl->head();
$curl->getCookies(); //array

$curl = new \Kenvix\curl\curl("https://www.bing.com/",array('User-Agent: chrome', 'Referer: https://kenvix.com'));

$curl->setHeaders(array('User-Agent: chrome', 'Referer: https://kenvix.com'));

$curl->put($data);
$curl->delete($data);

$curl->get(false);
$curl->post([...], false);

$curl->addCookie('yes=sir');

$curl->addCookie([
    'a' => 'foo',
    'b' => 'excited'
]);