1. Go to this page and download the library: Download olenagi/curl-wrap 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/ */
olenagi / curl-wrap example snippets
use olenagi\CurlWrap\Curl;
$curl = new Curl("http://www.example.com");
$response = $curl->get();
if ($response->isOk()) {
echo "Request was successful!";
}
use olenagi\CurlWrap\Curl;
$curl = new Curl("http://www.example.com");
$curl->setFile($filePath);
$response = $curl->post();
if ($response->isOk()) {
echo "Request was successful!";
}
use olenagi\CurlWrap\Curl;
use olenagi\CurlWrap\CurlMulti;
$curl = new Curl();
$curl->setOpt(CURLOPT_RETURNTRANSFER, true);
$curl->setFile($this->filePath);
$curl->setUrl("http://check.loc/index.php");
$curl2 = new Curl();
$curl2->setOpt(CURLOPT_RETURNTRANSFER, true);
$curl2->setFile($this->filePath);
$curl2->setUrl("http://check.loc/index2.php");
$curlMulti = new CurlMulti();
$curlMulti->add($curl->getResource());
$curlMulti->add($curl2->getResource());
$responses = $curlMulti->run();
foreach($responses as $response){
if ($response->isOk()) {
echo "Request was successful!";
}
}
Loading please wait ...
Before you can download the PHP files, the dependencies should be resolved. This can take some minutes. Please be patient.