Answer the question
In order to leave comments, you need to log in
How to set selector in php-html-parser?
There is a library https://github.com/paquettg/php-html-parser/
The search for an html block with the desired id is searched like this:
$dom = new Dom;
$dom->loadFromFile('tests/big.html');
$contents = $dom->find('#block-id');
<div id="project1"></div>
<div id="project2"></div>
<div id="project3"></div>
<div id="project4"></div>
for($i = 0; $i < 5; $i++){
$contents = $dom->find('#project' . $i);
}
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question