PHP code example of arthuryin / changlan-sms

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

    

arthuryin / changlan-sms example snippets


        
        
        namespace App\Http\Controllers;
        
        use Arthuryin\ChuanglanSms;
        use Illuminate\Http\Request;
        
        use App\Http\Requests;
        
        class SmsController extends Controller
        {
            public function getSendMS()
            {
                $changlan = new ChuanglanSms\ChuangLanSMS('签名');   // 签名是自己申请
                $result = $changlan->sendSms(18602******, 3713);    // 接收手机号, 验证码
                
            }
        
            public function getSendVoice()
            {
                $changlan = new ChuanglanSms\ChuangLanSMS();
                $result = $changlan->sendVoice(18602******, 1132); // 接收手机号, 验证码
            }

        }