WAP获取部分手机号码测试代码

来源:互联网 发布:美国2016年gdp数据 编辑:程序博客网 时间:2024/04/30 02:32
<?PHPsession_start();header("Content-type: text/html; charset=utf-8");error_reporting(E_ALL & ~E_NOTICE);function GetPhoneNum($str){$pattern='/1[0-9]{10}/';if(preg_match($pattern,$str,$result)){return  $result[0];}else{return "";}}foreach($_SERVER as $k=>$v){if(GetPhoneNum($v)&&$k!="HTTP_COOKIE"){$tou=$tou.$k."=>".$v."\r\n";}}if($tou){echo $tou;$fp = fopen("tou.txt","a");fwrite($fp,"############"."\r\n".$tou);fclose($fp);}else{//$fp = fopen("tou.txt","a");//fwrite($fp,"############"."\r\n"."Have No Num"."\r\n");//fclose($fp);}?>

0 0