Home > Backend Development > PHP Tutorial > php怎么写获取两个标签内的内容的正则表达式啊?

php怎么写获取两个标签内的内容的正则表达式啊?

WBOY
Release: 2016-06-23 14:08:46
Original
1492 people have browsed it

<?php    $url = "http://www.xxx.com";//页面地址    $info=file_get_contents($url);//获取页面信息?>
Copy after login

请教,没学过php,但临时要用一下,
我要获取那个网页从

到之间的内容,但是preg_match和正则表达式我不会写。
麻烦大家了


回复讨论(解决方案)

参考

$p='#<TD align="left" colSpan="4">(.+?)</TD>#s';preg_match($p,$info,$m);echo $m[1];
Copy after login
Copy after login

参考

$p='#<TD align="left" colSpan="4">(.+?)</TD>#s';preg_match($p,$info,$m);echo $m[1];
Copy after login
Copy after login

谢谢,太谢谢了!!!1

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