attempting to get last a tag and apply a class

$dom = new DOMDocument;
$dom->loadHTML($embed_html, LIBXML_HTML_NOIMPLIED);
$nodelinks = $dom->getElementsByTagName('a');
$links = iterator_to_array($nodelinks);
foreach ( $links as $link ) {
				if (end($links)) {
$embed_html = $dom->saveHTML();

Responding with a post on your own blog? Send me a Webmention by writing something on your website that links to this post and then enter your post URL below.

  • No Reposts.

Got Something To Say?

Your email address will not be published. Required fields are marked *