时间:2021-07-01 10:21:17 帮助过:4人阅读
查询结果如下: 该交通违法有记录! 信息来源: 非现场记录 文书号/决定书号/文书编号: 未裁决,无 车牌号码: 粤K32889 车主名称: 号牌种类: 违法时间: 2011-02-08 15:21:52.0 违法地点: 省道高铜线台山市斗山镇路段 采集机关: 台山市公安局交通警察大队斗山中队 所在地市: 违法行为名称: 机动车行驶超过规定时速50%以下的 处理地点: 台山市台城缠溪松山咀 处理地点联系电话: 0750-5520011 信息来源: 非现场记录 文书号/决定书号/文书编号: 未裁决,无 车牌号码: 粤K32889 车主名称: 号牌种类: 违法时间: 2010-10-25 07:12:57.0 违法地点: 东莞市长安镇莱茵阁路口(固定电子警察) 采集机关: 东莞市公安局交通警察支队长安大队 所在地市: 违法行为名称: 机动车通过有灯控路口时,不按所需行进方向驶入导向车道的 处理地点: 东莞市长安镇大板地工业大道1号 处理地点联系电话: 0769-81661611 信息来源: 非现场记录 文书号/决定书号/文书编号: 未裁决,无 车牌号码: 粤K32889 车主名称: 号牌种类: 违法时间: 2010-12-29 20:34:39.0 违法地点: 振安夏边路口(东-西) 采集机关: 东莞市公安局交通警察支队长安大队 所在地市: 违法行为名称: 机动车通过有灯控路口时,不按所需行进方向驶入导向车道的 处理地点: 东莞市长安镇大板地工业大道1号 处理地点联系电话: 0769-81661611 设为首页 | 加入收藏 | 联系方法 | 网站地图 | 友情链接 | 版权声明 版权所有 2006 广东省公安厅交通管理局政务服务网 ePRO易宝电脑系统(广州)有限公司提供技术支持 未经许可不得转载及建立镜像 否则追究法律责任
$array[0][0]=非现场记录$array[0][1]=2011-02-08 15:21:52.0$array[0][2]=省道高铜线台山市斗山镇路段$array[0][3]=台山市公安局交通警察大队斗山中队$array[0][4]=机动车行驶超过规定时速50%以下的$array[0][5]=台山市台城缠溪松山咀$array[1][0]=非现场记录$array[1][1]=2010-10-25 07:12:57.0..............................................................$array[2][5]=东莞市长安镇大板地工业大道1号
随便写了下,测试效果初步出来了。只是还有所欠缺,只当抛砖引玉吧
([\S|/]+:\s)([\S]+)
$str = <<';/** *Array( [0] => Array ( [0] => 非现场记录 [1] => 2011-02-08 15:21:52.0 [2] => 省道高铜线台山市斗山镇路段 [3] => 台山市公安局交通警察大队斗山中队 [4] => 机动车行驶超过规定时速50%以下的 [5] => 台山市台城缠溪松山咀 ) [1] => Array ( [0] => 非现场记录 [1] => 2010-10-25 07:12:57.0 [2] => 东莞市长安镇莱茵阁路口(固定电子警察) [3] => 东莞市公安局交通警察支队长安大队 [4] => 机动车通过有灯控路口时,不按所需行进方向驶入导向车道的 [5] => 东莞市长安镇大板地工业大道1号 ) [2] => Array ( [0] => 非现场记录 [1] => 2010-12-29 20:34:39.0 [2] => 振安夏边路口(东-西) [3] => 东莞市公安局交通警察支队长安大队 [4] => 机动车通过有灯控路口时,不按所需行进方向驶入导向车道的 [5] => 东莞市长安镇大板地工业大道1号 )) **/够无聊,还不如直接截取字符串.';print_r($res);echo '
PHP code
$str = <<
ZT_King是正则达人,受教了,学习了
牛人阿
PHP code
$str = <<
ZT_King 怎么截取啊?Google了1天没找到,正则搞的我头大
$str = <<
这个是什么意思
我的源码保存在一个变量$b里 怎么用啊
$str=$b; 这样不可以 应该怎么用<<
data
NAME
表示原文档,你可以认为是单双引号,是用来做示例文档的.可以在data间放入自己的内容.
如果$str=$b后还不能用,那就是$b内容的编码问题了,可以试试$str = iconv('gbk','utf8',$b);转码还是不行 $b是多行的内容.是不是应该改一下正则表达式来匹配多行.应该怎么改啊
非常感谢
<<data
NAME
表示原文档,你可以认为是单双引号,是用来做示例文档的.可以在data间放入自己的内容.
如果$str=$b后还不能用,那就是$b内容的编码问题了,可以试试$str = iconv('gbk','utf8',$b);已经是全部数据匹配了,刚检查了下,循环出错了,测试数据刚好取了6条,所以没发现.下面已改正
数据不正常,你应该多检查下编码.
for ($i = 0; $i < count($matches[0]); $i++){插入加红没起作用,第一个循环用$matches[0]做限制.
插入加红没起作用,第一个循环用$matches[0]做限制.
问题好像不是出在这里,而是在匹配多行上的问题
$str = <<
这样就没法匹配成功了可以把所有的\n去掉然后匹配。
str_replace();错,应该是
那多一个工序,直接改匹配算法不行吗
改这个preg_match_all('/ 信息来源 :\s(.+)\s.+ #来源# :\s([\d \-\.:]+\.0).+ #时间# :\s(.+)\s.+ #地点# :\s(.+)\s.+ #采集机关# :.+: \s(.+)\s.+ #违法行为名称# \s(.+)\s.+ #处理地点# \d{4}\-\d{5,} /Usx', $str, $matches);
错,应该是
$str = <<';/** * Array( [0] => Array ( [0] => 非现场记录 [1] => 2011-02-08 15:21:52.0 [2] => 省道高铜线台山市斗山镇路段 [3] => 台山市公安局交通警察大队斗山中队 [4] => 机动车行驶超过规定时速50%以下的 [5] => 台山市台城缠溪松山咀 ) [1] => Array ( [0] => 非现场记录 [1] => 2010-10-25 07:12:57.0 [2] => 东莞市长安镇莱茵阁路口(固定电子警察) [3] => 东莞市公安局交通警察支队长安大队 [4] => 机动车通过有灯控路口时,不按所需行进方向驶入导向车道的 [5] => 东莞市长安镇大板地工业大道1号 ) [2] => Array ( [0] => 非现场记录 [1] => 2010-12-29 20:34:39.0 [2] => 振安夏边路口(东-西) [3] => 东莞市公安局交通警察支队长安大队 [4] => 机动车通过有灯控路口时,不按所需行进方向驶入导向车道的 [5] => 东莞市长安镇大板地工业大道1号 )) * */';print_r($res);echo ' PHP code
……
假设
表单内容是
识别验证码的模块是
$img="a.jpg" //当前目录下的验证码图片名字include ('Valite.php');$valite = new Valite();$valite->setImage($img);$valite->getHec();$ert = $valite->run();//$ert就是识别出来的数字
提交表单我用snoopy
include "Snoopy.class.php"; $snoopy = new Snoopy; $submit_url = "http://www.gdgajj.com/cx/wzss/wzss.do"; $submit_vars["jc"] = "amiga"; $submit_vars["randcode2"] = $ert; $snoopy->submittext($submit_url,$submit_vars);
现在的问题是:我如何获取验证码
用
$snoopy->fetch("http://www.gdgajj.com/cx/servlet/ImageServlet");
还是用什么,已确保获取验证码的时候,他们服务器的session已经记录了.
如何把我发的这几段代码链接起来.
"识别验证码的模块"和"模拟提交表单的模块"怎样结合起来?
$im = imagecreatefromjpeg('http://www.gdgajj.com/cx/servlet/ImageServlet');imagejpeg($im, 'a.jpg');//这样保存图片,然后用那个程序解析出数字,再然后用snoopy提交请问这样一个字符串$str
$str='[0,"通信与信息工程学院","","","","",3,"","","",-1,2,"通信工程","","","",3,"","pubStuKebiao.php?zyh=0101","frameList",2,
"电子信息工程","","","",3,"","pubStuKebiao.php?zyh=0102","frameList",2,"电子信息科学与技术","","","",3,"","pubStuKebiao.php?
zyh=0103","frameList",2,"信息工程","","","",3,"","pubStuKebiao.php?zyh=0104","frameList",2,"广播电视工程","","","",3,"","pubS
tuKebiao.php?zyh=0105","frameList",2,"通信与信息类","","","",3,"","pubStuKebiao.php?zyh=0114","frameList",2,"通信与信息类实验
班","","","",3,"","pubStuKebiao.php?zyh=0118","frameList",2,"通信学院卓越班","","","",3,"","pubStuKebiao.php?zyh=0190","frameList"
,2,"通信学院IT精英班","","","",3,"","pubStuKebiao.php?zyh=0191","frameList",2,"通信工程国际实验班","","","",3,"","pubStuKebiao.php
?zyh=0192","frameList",2,"电子信息工程(通信技术方向)","","","",3,"","pubStuKebiao.php?zyh=2003","frameList",2,"电子信息工程(通信技
术)","","","",3,"","pubStuKebiao.php?zyh=5101","frameList",2,"电子信息工程(应用电子技术)","","","",3,"","pubStuKebiao.php?zyh=5102","
frameList",2,"电子信息工程类(实验班)","","","",3,"","pubStuKebiao.php?zyh=5109","frameList",1,0,"光电工程学院","","","","",3,"","",""
,-1,2,"光信息科学与技术","","","",3,"","pubStuKebiao.php?zyh=0201","frameList",2,"微电子学","","","",3,"","pubStuKebiao.php?zyh=0202"
,"frameList",2,"电子科学与技术","","","",3,"","pubStuKebiao.php?zyh=0203","frameList",2,"电子工程类","","","",3,"","pubStuKebiao.php
?zyh=0211","frameList",2,"微电子工程实验班","","","",3,"","pubStuKebiao.php?zyh=0219","frameList",1,0,"经济管理学院","","","","",3,
"","","",-1,2,"信息管理与信息系统","","","",3,"","pubStuKebiao.php?zyh=0301","frameList",2,"会计学","","","",3,"","pubStuKebiao.php
?zyh=0302","frameList",2,"经济学","","","",3,"","pubStuKebiao.php?zyh=0303","frameList",2,"市场营销","","","",3,"","pubStuKebiao.ph
p?zyh=0304","frameList",2,"工商管理","","","",3,"","pubStuKebiao.php?zyh=0305","frameList",2,"电子商务","","","",3,"","pubStuKebiao
.php?zyh=0306","frameList",2,"工程管理","","","",3,"","pubStuKebiao.php?zyh=0308","frameList",2,"信息管理类","","","",3,"","pubStuK
ebiao.php?zyh=0311","frameList",2,"工商管理类","","","",3,"","pubStuKebiao.php?zyh=0312","frameList",2,"国际化会计人才培养实验班","
","","",3,"","pubStuKebiao.php?zyh=0318","frameList",2,"工商管理类实验班","","","",3,"","pubStuKebiao.php?zyh=0390","frameList",2,"
经济学实验班","","","",3,"","pubStuKebiao.php?zyh=0391","frameList",2,"市场营销(企业营销与管理方向)","","","",3,"","pubStuKebiao.
php?zyh=2004","frameList",2,"信息管理与信息系统","","","",3,"","pubStuKebiao.php?zyh=2009","frameList",1,0,"计算机科学与技术学院","
","","","",3,"","","",-1,2,"计算机科学与技术","","","",3,"","pubStuKebiao.php?zyh=0401","frameList",2,"地理信息系统","","","",3,"",
"pubStuKebiao.php?zyh=0402","frameList",2,"网络工程","","","",3,"","pubStuKebiao.php?zyh=0403","frameList",2,"信息安全","","","",3,
"","pubStuKebiao.php?zyh=0404","frameList",2,"智能科学与技术","","","",3,"","pubStuKebiao.php?zyh=0405","frameList",2,"计算机与智能
科学类","","","",3,"","pubStuKebiao.php?zyh=0412","frameList",2,"计算机与智能科学类实验班","","","",3,"","pubStuKebiao.php?zyh=0418
","frameList",2,"计算机学院卓越班","","","",3,"","pubStuKebiao.php?zyh=0491","frameList",2,"计算机科学与技术","","","",3,"","pubStu
Kebiao.php?zyh=2001","frameList",2,"计算机科学与技术(计算机应用)","","","",3,"","pubStuKebiao.php?zyh=5301","frameList",2,"计算机科
学与技术(网络技术)","","","",3,"","pubStuKebiao.php?zyh=5302","frameList",2,"计算机科学与技术(信息安全)","","","",3,"","pubStuKebi
ao.php?zyh=5303","frameList",2,"计算机科学与技术类(实验班)","","","",3,"","pubStuKebiao.php?zyh=5309","frameList",1,0,"外国语学院"
,"","","","",3,"","","",-1,2,"英语","","","",3,"","pubStuKebiao.php?zyh=0501","frameList",2,"英语(商贸)","","","",3,"","pubStuKebia
.php?zyh=5401","frameList",1,0,"生物信息学院","","","","",3,"","","",-1,2,"生物医学工程","","","",3,"","pubStuKebiao.php?zyh=0601","
frameList",2,"生物技术","","","",3,"","pubStuKebiao.php?zyh=0602","frameList",2,"中药学","","","",3,"","pubStuKebiao.php?zyh=0603","
frameList",2,"制药工程","","","",3,"","pubStuKebiao.php?zyh=0604","frameList",2,"生物信息学","","","",3,"","pubStuKebiao.php?zyh=060
5","frameList",2,"生物技术与制药类","","","",3,"","pubStuKebiao.php?zyh=0611","frameList",2,"生物技术(生物信息学方向)","","","",3,
"","pubStuKebiao.php?zyh=0615","frameList",2,"生物与制药类实验班","","","",3,"","pubStuKebiao.php?zyh=0690","frameList",1,0,"法学院",
"","","","",3,"","","",-1,2]';
正则怎样写能达到这样的二维数组