PHP code example of zhenggg / easy-ihuyi

1. Go to this page and download the library: Download zhenggg/easy-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/ */

    

zhenggg / easy-ihuyi example snippets


use Zhenggg\Huyi\EasyHuyi;

$config = [
    'APIID' => 'xxx',
    'APIKEY' => 'xxx',
];
//$phone_number 多个号码以英文,隔开

$huyi = new EasyHuyi($config);

//短信验证码/通知
$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);