PHP code example of lawyi / baimifan

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

    

lawyi / baimifan example snippets


$code   = rand(1000, 9999);
$time   = 5;
$name   = ''; // 尾巴
$mobile = '18267xxxxxx';

$config = [
    'appkey'       => '',
    'secret'       => '',
    'template_id'  => '57', // 模版ID
    'signature_id' => '293', // 签名ID
    'context'      => [  // 模版变量
        'code' => $code,
        'time' => $time,
        'name' => $name,
    ]
];

$res = \Baimifan\Sms::baichuan($config)->to($mobile)->send();