因为我的项目的须要,我找了一个能够间接复制粘贴的短信验证码接入示例,当初分享进去,心愿能够进步各位同仁的工作效率,代码如下:
`
<?php
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => “https://vip.veesing.com/smsApi/verifyCode”,
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => “”,
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 0,
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => “POST”,
CURLOPT_POSTFIELDS => “appId=41KYR0EB&appKey=IIWCKKSR7NOQ&phone=1561894**&templateId=1043&variables=1234″,
CURLOPT_HTTPHEADER => array(
"Content-Type: application/x-www-form-urlencoded;charset=utf-8"
),
));
$response = curl_exec($curl);
curl_close($curl);
echo $response;
`
这是各大云市的短信供应商的短信接口,稳定性方面,大家也能够测试一下,我本人测过,自认为十分稳固,原创不易,心愿大家给个三连。
PHP – cURL.php 和文档阐明下载