PHP code example of marlon / yuntongxun

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

    

marlon / yuntongxun example snippets



$result = Sms::send($mobile, $info, $id);
/*
 * $mobile 为发送的手机号,为字符串,多个手机号用逗号分隔
 * $info 为发送的验证码以及有效时间,为数组
 * $id 为要发送的模板id
 * Sms::send会有返回值,为数组形式
 * return Array(
 *     'to' => '18635634441',   发送的手机号
 *     'status' => '0'          状态码,状态码为0的情况下为发送成功
 * )
 */