Home > Backend Development > PHP Tutorial > php正则表达方式输出结果过滤,该如何处理

php正则表达方式输出结果过滤,该如何处理

WBOY
Release: 2016-06-13 13:22:52
Original
983 people have browsed it

php正则表达方式输出结果过滤

PHP code
<!--

Code highlighting produced by Actipro CodeHighlighter (freeware)
http://www.CodeHighlighter.com/

--><?php $url="http://117.36.53.122:9082/wfcx/query.do?actiontype=vioSurveil&hpzl=02&hphm=AP808P&tj=SYR&tj_val=%E5%8F%B1%E4%B8%BA%E5%9F%8E";
$s=file_get_contents($url);
preg_match_all('/<table width="100%"[^>]+>(.*)
/isU',$s,$m);
for ($i=0; $i".$m[1][$i]."\n";
}
?> 
Copy after login

查询输出得到结果
HTML code
<!--

Code highlighting produced by Actipro CodeHighlighter (freeware)
http://www.CodeHighlighter.com/

-->
Copy after login
号牌种类  小型汽车 号牌号码  ax098 中文品牌  上海波罗
车辆型号  SVW7144CLi 车辆类型  轿车 车身颜色  蓝
检验有效期止  2013-01-31 强制报废期止  2099-12-31 机动车状态  违法未处理
机动车所有人  某某/td>
号牌号码 号牌种类 违法时间 违法地点 违法行为 发现机关 信息来源
ax098 小型汽车 2012-05-15 13:48:12.0 建工路 电子警察]机动车违反标志标线指示 新城大队五中队(长乐路中队) 电子警察
Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template