public function read() { $pwd = md5(123456); $code = rand(1000,9999); $c = ‘【下雨苏里】你的验证码是:‘.$code.‘,3分钟内有效!‘; $url ="http://api.smsbao.com/sms?u=3240491372&p=$pwd&m=15294642681&c=$c"; $ch = curl_init(); curl_setopt($ch,CURLOPT_URL,$url); curl_setopt($ch,CURLOPT_RETURNTRANSFER,true); $res = curl_exec($ch); var_dump($res); }