yousefyahya / alquran-api-client
AlQuran.cloud REST API 客户端
v1.1
2020-06-04 10:05 UTC
Requires
- guzzlehttp/guzzle: ^6.1
Requires (Dev)
- phpunit/phpunit: 4.7.*
This package is auto-updated.
Last update: 2024-10-01 13:53:33 UTC
README
AlQuran Cloud API 客户端(PHP)
这是一个使用 alquran.cloud 的 REST API 来获取《古兰经》的章节、篇章、卷或整本《古兰经》的 PHP API 客户端。
安装
API 客户端是一个 composer 包。要使用它,您需要运行以下命令:
composer require alquran/api-client
用法
实例化客户端
$t = new \AlQuranCloud\ApiClient\Client();
获取章节
要获取单个章节,请使用以下命令:
$t->ayah(765); // This will return Ayah 765
$t->ayah(765, 'en.pickthall'); // This will return Ayah 765 with Marmaduke Pickthall's English translation
$t->ayah('2:255'); // This will return Surah 2, Ayah 255 (which is Ayat Al Kursi)
获取篇章
要获取篇章,请使用以下命令:
$t->surah(36); // This will return Surah Yaseen
$t->surah(36, 'en.asad'); // This will return Surah Yaseen with Muhammad Asad's English translation
获取卷
要获取卷,请使用以下命令:
$t->juz(30); // This will return Juz 30 (there are only 30!)
获取版本、搜索等...
请参阅完整的文档,见 docs/index.html(克隆存储库,然后在浏览器中打开文件)。
作者和贡献者
Meezaan-ud-Din Abdu Dhil-Jalali Wal-Ikram (@meezaan)。
支持或联系
有关支持,请访问 http://alquran.cloud/api 或 http://alquran.cloud/contact。