$text,'apikey'=>$apikey,'mobile'=>$mobile); curl_setopt($ch, CURLOPT_URL, 'https://sms.yunpian.com/v2/sms/single_send.json'); curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($data)); curl_setopt($ch, CURLOPT_RETURNTRANSFER,true); $result = json_decode(curl_exec($ch),true); if ($result && $result['code'] != 0) { Log::info('短信发送失败:号码:' . $mobile . '; 短信内容:' . $text . '; 错误代码:' . $result['code'] . '; 错误详情:' . $result['msg']); SmsLog::fail($mobile, $text, $result); return false; } SmsLog::success($mobile, $text, $result); return true; } }