黄波诺文 / php
为 SabaNovin 的 REST API 提供的 PHP 封装
v1.0.3
2020-11-20 08:52 UTC
Requires
- php: >=5.4.0
- sabanovin/php: *
This package is not auto-updated.
Last update: 2024-09-23 07:22:21 UTC
README
安装
使用方式
composer require sabanovin/php
用法
通过 SabaNovin API 发送简单短信
require __DIR__ . '/vendor/autoload.php'; try{ $api = new \SabaNovin\SabaNovinApi( "API-Key" ); $gateway = "100020500"; $text = "متن تست"; $to = array("09370000000", "09120000000"); $result = $api->Send($gateway, $to, $text); if($result->entries){ foreach($result->entries as $entry) { echo "reference_id = $entry->reference_id"; echo "status = $entry->status"; echo "mobile = $entry->mobile"; echo "datetime = $entry->datetime"; } } } catch(\SabaNovin\Exceptions\ApiException $e){ echo $e->errorMessage(); }