How to get elements by layer in php simple_html_dom?

WBOY
Release: 2016-09-21 13:56:42
Original
882 people have browsed it

I only want to get the TR of the first level table, that is, COUNT equals 1. How should I write it correctly?

$html = new simple_html_dom();

$html->load('
1111122222
3333
'); $trs = $html->find('table',0)->find('tr'); //我想得到的是该table的直属tr,亲儿子。 $count = count($trs); echo $count;
Copy after login
Related labels:
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 [email protected]
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!