开发者

extract part of html using tidy in php

开发者 https://www.devze.com 2022-12-28 05:54 出处:网络
I want to extract particular part of HTML using tidy in php. the html page has table in it and i just want t开发者_Python百科o fetch that table from html page.

I want to extract particular part of HTML using tidy in php.

the html page has table in it and i just want t开发者_Python百科o fetch that table from html page.

please help and post the solution....

Thanks


The PHP Simple DOM parser is better suited for the job I think. There are good usage examples on the site.

A function to grab a table should look like this (untested but should work):

echo $html->find('table[id=mytable]', 0)->plaintext;
0

精彩评论

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

关注公众号