Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我想在 php 中使用 tidy 提取 HTML 的特定部分。
html 页面中有表格,我只想从 html 页面中获取该表格。
请帮助并发布解决方案....
谢谢
PHP Simple DOM 解析器更适合我认为的工作。网站上有很好的使用示例。
抓取表格的函数应该如下所示(未经测试但应该可以工作):
echo $html->find('table[id=mytable]', 0)->plaintext;