Home  >  Article  >  Backend Development  >  关于PHP正则表达式提取远程页面中的Table内容解决方法

关于PHP正则表达式提取远程页面中的Table内容解决方法

WBOY
WBOYOriginal
2016-06-13 13:27:051082browse

关于PHP正则表达式提取远程页面中的Table内容
想提取远程指定url中的table所有内容(包括html代码),使用PHP正则表达式应该如何写?
例如需要提取该页面中table所有的内容:http://www.tzga.gov.cn:6080/wscgs/vio.do?act=veh_vio_query

------解决方案--------------------

PHP code
$s=file_get_contents('http://www.tzga.gov.cn:6080/wscgs/vio.do?act=veh_vio_query');
preg_match_all('/
]+>(.*)/isU',$s,$m); print_r($m[1]);
Statement:
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