$i = 0;
            foreach ($links as $link) {
                   if($i >= 8){ break; }
                    $i++;
                    $text = trim($link->nodeValue);
                    $text = preg_replace('/^\d+\./', '', $text);
                    echo "<li><a class='content-tags-content' href='https://mysite.net/search/" . $text . "'>" . mb_strimwidth($text, 0, 25, '...') . "<p class='content-tags-help'>Trending Now</p></a></li>";
            }