Heim  >  Artikel  >  Backend-Entwicklung  >  php正则表达方式输出结果过滤,该如何处理

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

WBOY
WBOYOriginal
2016-06-13 13:22:52949Durchsuche

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";
}
?> 

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

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

-->
号牌种类  小型汽车 号牌号码  ax098 中文品牌  上海波罗
车辆型号  SVW7144CLi 车辆类型  轿车 车身颜色  蓝
检验有效期止  2013-01-31 强制报废期止  2099-12-31 机动车状态  违法未处理
机动车所有人  某某/td>
号牌号码 号牌种类 违法时间 违法地点 违法行为 发现机关 信息来源
ax098 小型汽车 2012-05-15 13:48:12.0 建工路 电子警察]机动车违反标志标线指示 新城大队五中队(长乐路中队) 电子警察
Stellungnahme:
Der Inhalt dieses Artikels wird freiwillig von Internetnutzern beigesteuert und das Urheberrecht liegt beim ursprünglichen Autor. Diese Website übernimmt keine entsprechende rechtliche Verantwortung. Wenn Sie Inhalte finden, bei denen der Verdacht eines Plagiats oder einer Rechtsverletzung besteht, wenden Sie sich bitte an admin@php.cn