pel/freesound-api

用于消费freesound API的类。

dev-master 2019-05-10 01:28 UTC

This package is not auto-updated.

Last update: 2024-09-28 18:10:42 UTC


README

Build Status

freesound-api

关于

这是一个PSR-4 PHP类,用于消费freesound的API。

http://www.freesound.org/

使用方法

以下是如何使用freesound-api类的示例。

include('FreesoundAPI.php');

$api_key = 'g1d11a5117a4143be0f5f';
$curl_options = array();

$api = new Pel\Helper\FreesoundAPI($api_key, $curl_options);

$result = $api->sound(123);

if ($result === FALSE) {
    echo 'Error code = ' . $api->error['code'] . '<br/>';
    echo 'Error message = ' . $api->error['message'] . '<br/>';
} else {
    var_dump($result);
}

查看类的源代码以查看所有可能的API调用。