PHP code example of jimchen / mob-sms
1. Go to this page and download the library: Download jimchen/mob-sms 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/ */
jimchen / mob-sms example snippets
use JimChen\MobSms\MobSms;
$sms = new MobSms([
'appkey' => '27xxxxxxxxx',
'zone' => 86, // 区号
// 接口请求相关配置,超时时间等,具体可用参数请参考:
// http://docs.guzzlephp.org/en/stable/request-config.html
'http' => [
'max_retries' => 1,
'retry_delay' => 500,
'timeout' => 5.0,
]
]);
$sms->verify('phone number', 'verification code');