Best laravel framework open-source packages.

YiiCurl

A curl library for Yii
Updated 1 year ago

NOTE: No Longer Maintained

This package is no longer being maintained, use http://guzzlephp.org/ instead!


Introduction

A curl wrapper for Yii, allows easier access to curl functions.

Example usage

To grab a url:

$curl = new ACurl();
$data = $curl->get("http://www.google.com/")->data;
echo $data;

To retrieve just the headers for a URL:

$curl = new ACurl();
$headers = $curl->head("http://www.google.com/")->headers;
print_r($headers);

To post data to a URL:

$curl = new ACurl();
$response = $curl->post("http://example.com/",array("key" => "value"))->data;
echo $response;

To load JSON from a URL:

$curl = new ACurl();
$response = $curl->get("http://www.example.com/test.json")->fromJSON();
print_r($response);
Tags curl php