PHP code example of willwashburn / curl

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

    

willwashburn / curl example snippets


class SomeClassThatUsesCurl {


    protected $curl;

    public function __construct(WillWashburn\Curl $curl) {
    
        $this->curl = $curl;
    
    }
    
    public function someMethodThatMakesARequest() {
    
        // Use curl like normal but also be able to test!
        $ch = $this->curl->curl_init($url);
        $this->curl->curl_setopt($ch, CURLOPT_HEADER, true);
    
    }


}