PHP code example of peterfrench / yii2-curl

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

    

peterfrench / yii2-curl example snippets


	'curl' => [
		'class' => 'peterfrench\curl\Curl',
		'options' => [
			/* curl options */
		],
	],

	$output = Yii::$app->curl->get($url, $params);
	// output will contain the result of the query
	// $params - query that'll be appended to the url

	$output = Yii::$app->curl->post($url, $data);
	// $data - data that will be POSTed

bash
php composer.phar