开发者

trying to use preg_match_all to get table contents from page

I have an html page and开发者_如何学Python I want to get the contents in a table. the table starts with grid tag and ends with grid tag,

My function is this:

preg_match_all("/<grid>.*<\/grid>/",$page, $matches,PREG_OFFSET_CAPTURE);

I get a null array.


Don't use a regex, use something like QueryPath - I've used it dozens of times with great success. It works like jQuery, for PHP.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜