I need to get the text between the tags of a site:
<a href="">Este Texo</a>
I'm getting your href
with this code:
$dadosSite = file_get_contents($utl);
$dom = new DOMDocument;
@$dom->loadHTML($dadosSite);
$links = $dom->getElementsByTagName('a');
foreach ($links as $link)
{
$termo = 'video';
$pattern = '/' . $termo . '/';
if (preg_match($pattern, $link->getAttribute('href')))
{
echo $link->getAttribute('href');
}
}