<?php

$html = <<< EOF
<img border="0" src="imagenes/flech.gif" width="6" height="8">

<a href="escuchar-baladas-de-Albano_Y_Romina_Power.html">Albano Y Romina Power</a><br>
<img border="0" src="imagenes/flech.gif" width="6" height="8">

<a href="escuchar-baladas-de-Armando_Manzanero.html">Armando Manzanero</a><br>

<a name="inicio21" href="musica-Merengue-de-Banda_Cuisillos.html">
<img border="0" src="imagenes/flech.gif" width="6" height="8">Banda Cuisillos</a><br>

<a href="Musica-Baladas-Alternativas.html">Baladas Alternativas</a><br>
EOF;


$dom = new DOMDocument();

# Parse the HTML from Google.
# The @ before the method call suppresses any warnings that
# loadHTML might throw because of invalid HTML in the page.
@$dom->loadHTML($html);

# Iterate over all the <a> tags
foreach($dom->getElementsByTagName('a') as $link) {
	
	$url =  $link->getAttribute('href');
	$text = preg_replace('/[\r\n]/sm', '', $link->nodeValue); // remove line breaks
	
	//if doesn't contain the banned words...
	if (!preg_match('/(Baladas Alternativas|another text to filter)/sm', $text)) {
        echo $url ." ".$text. "\n";
    } 

}