<?php
header("content-Type: text/html; charset=utf-8");
//配置区
$sid='';
$url='https://hu60.cn/wap/0wap/?cid=msg&pid=list&read=0&sid='.$sid;
$ch = curl_init();
curl_setopt($ch,CURLOPT_URL,$url);
curl_setopt($ch,CURLOPT_HEADER,false);
curl_setopt($ch,CURLOPT_TIMEOUT,2);
curl_setopt($ch,CURLOPT_SSL_VERIFYPEER,false);
curl_setopt($ch,CURLOPT_COOKIE,$sid);
curl_setopt($ch,CURLOPT_RETURNTRANSFER,true);
$str=curl_exec($ch);
curl_close($ch);
if(!strpos($str,'没有未读消息')){
$zz='#<div class="(?:.*)">(?:.*)、(未读)(.*):“<a href="(?:.*)">(.*)</a>”\((.*)\)</div>#iUs';
preg_match_all($zz,$str,$array);
$sun=count($array[1]);
for($i=0;$i<$sun;$i++){
$sms='[发信人]:'.$array[1][$i].'[内容]:'.$array[2][$i].'[时间]:'.$array[3][$i];
//使用飞信接口
$url='http://v.milog.cn/fx/sms.php?id=你的idUser&cookie=*******&txt='.urlencode($sms);
echo file_get_contents($url);
}
}
由于我没有移动卡 拿我妈的卡来测试
效果图: