PHP code example of ptx / lumen-ihuyi
1. Go to this page and download the library: Download ptx/lumen-ihuyi library . Choose the download type require .
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
ptx / lumen-ihuyi example snippets
'sms'=>[
'APIID' => env('HUYI_API_ID', ''),
'APIKEY' => env('HUYI_API_KEY', ''),
],
'yxsms'=>[
'APIID' => env('HUYI_YX_API_ID', ''),
'APIKEY' => env('HUYI_YX_API_KEY', ''),
],
'voice'=>[
'APIID' => env('HUYI_VOICE_API_ID', ''),
'APIKEY' => env('HUYI_VOICE_API_KEY', ''),
],
'mms'=>[
'APIID' => env('HUYI_MMS_API_ID', ''),
'APIKEY' => env('HUYI_MMS_API_KEY', ''),
],
'isms'=>[
'APIID' => env('HUYI_ISMS_API_ID', ''),
'APIKEY' => env('HUYI_ISMS_API_KEY', ''),
],
//$phone_number 多个号码以逗号分隔传入
//短信验证码/通知
Huyi::sms()->content($content)->send($phone_number);
//语音验证码
Huyi::voice()->content($content)->send($phone_number);
//国际短信
Huyi::isms()->content($content)->send($phone_number);
//短信营销
Huyi::yxsms()->content($content)->send($phone_number);
//彩信营销(定时发送)
Huyi::yxsms()->content($content)->stime($time)->send($phone_number);
//彩信营销
Huyi::mms()->mmsid($mmsid)->pid($pid)->send($phone_number);