-
Notifications
You must be signed in to change notification settings - Fork 3
Methods Client Library
brianhaveri edited this page Sep 14, 2010
·
8 revisions
Method | Description | Parameter | Returns |
---|---|---|---|
set_result_type |
Set return type to ‘array’, ‘object’, or ‘raw’ (raw JSON or XML, whichever server responds with) | string $type
|
[none] |
last_request |
Get the last request sent to the API | [none] | string |
require_once('ColourLovers.php'); $c = new ColourLovers; $c->set_result_type('raw'); $result = $c->color('00FF00'); echo $result; // echoes XML
require_once('ColourLovers.php'); $c = new ColourLovers; $results = $c->colors(array( 'keywords' => 'sky+cloud', 'orderCol' => 'numVotes', 'sortBy' => 'ASC' )); // http://www.colourlovers.com/api/colors?keywords=sky%2Bcloud&orderCol=numVotes&sortBy=ASC echo $c->last_request();