The output of the script is: "Outstanding 1... Outstanding 2... Outstanding 3..."
How can I output the for example only the second position of the array, so that I can output the results separately?
Like this: $out[1]
<?php
$html = '
<div class="page-wrapper">
<section class="page single-review" itemtype="http://schema.org/Review" itemscope="" itemprop="review">
<article class="review clearfix">
<div class="review-content">
<div class="review-text" itemprop="reviewBody">
Outstanding 1...
</div>
<div class="review-text" itemprop="reviewBody">
Outstanding 2...
</div>
</div>
</article>
</section>
</div>
<div class="review-text" itemprop="reviewBody">
Outstanding 3...
</div>
';
$dom = new DOMDocument;
$dom->loadHTML ($html);
$xpath = new DOMXPath ($dom);
foreach ($xpath->query (".//div[@class='review-text']") as $review)
{
$out = $review->nodeValue;
echo $out;
}
?>