Heya there!
I’m trying to “combine” and use this two foreach loops at once, and I lost any idea how to do that.
[CODE] $blic_xpath = new DOMXPath($blic_doc);
// getting h4 elements
$podaci_levo = $blic_xpath->query(‘//h4’);
foreach($podaci_levo as $stubic){
echo $stubic->nodeValue;
}
// getting comments from div with class “inner”
$komentari = $blic_xpath->query(‘//div[@class=”inner”]’);
foreach($komentari as $kom){
echo $kom->nodeValue;
}
This will output data like this:
[CODE]
value1 value2 value 3 comment1 comment2 comment3
I would like it to be like:
[CODE]
value 1 comment1
value 2 comment 2
value 3 comment 3
…
I tried multiple combinations to make a table but whatever i try i always get a messy result. ?
Any help would be appreciated, as I’m a php beginner. Thanks!