I have HTML structure like this
<div class = article-comments>
<div class="article-comment">
<div class="article-comment-header">...</div>
<div class="article-comment-content">...</div>
</div>
<div class="article-comment">
<div class="article-comment-header">...</div>
<div class="article-comment-content">...</div>
</div>
</div>
.
.
.
</div>
I have one div element - comments which contains many other div elements- comment. I need to get header element, which contains comment creator name, and *content, which contains the comment. I have code in PHP like this:
foreach($bot->parseBetweenRegexArray($data, '<div.*class="article-comment-content">', '<\/div>') as $commentary ){
printf("comment: %s",$commentary);
foreach($bot->parseBetweenRegexArray($data, '<div.*class="article-comment-header">', '<\/div>') as $name) {
printf("name: %s",$name); '<br />';
}
}
But with this code I can't get correct order, like comment author name and corresponding comment and so on. How to do this?
Thanks!