PHP code example of jblond / phpcurl

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

    

jblond / phpcurl example snippets




use jblond\phpcurl\Client;
use jblond\phpcurl\Decoder;

 $client->get('http://localhost/test.json');
if( !is_array($response)){
    $content = $decoder->jsonToArray($response);
}
else
{
    $content = $response;
}
print_r($content);
print_r(
    $client->post(
        'http://localhost/post.php',
        json_encode(['lorem' => 'lol'])
    )
);