loadHTML($html); $xpath = new DOMXPath($dom); echo " Feed for $comic on GoComics $url"; foreach ($xpath->query('//a') as $a) { $href = $a->getattribute('href'); if (str_starts_with($href, "/$comic/")) { $href = urljoin($url, $href); echo " {$a->getattribute('title')} $href "; } } echo ""; ?>