It's only fair for this type of task that PHP supports XPath .
Suppose you have your HTML output that way and that it under a URL like localhost / emails.html:
<!DOCTYPE html>
<html>
<head></head>
<body>
<div class="tcell tquick">
<div style="background-color: #ddd; padding: 4px;">
<span> <b class="the_nome">Ciclano;</b> </span>
</div>
<br>
<div> </div>
<div>
<div class="c the_email">[email protected]</div>
</div>
<div> </div>
</div>
<div class="tcell tquick">
<div style="background-color: #ddd; padding: 4px;">
<span> <b class="the_nome">Fulano;</b> </span>
</div>
<br>
<div> </div>
<div>
<div class="c the_email">[email protected]</div>
</div>
<div> </div>
</div>
</body>
</html>
Then you could load this content into string with DOMDocument and use another class called DOMXPath :
<?php
$html_content = file_get_contents('http://localhost/emails.html');
$dom = @DOMDocument::loadHTML($html_content);
$xpath = new DOMXPath($dom);
$nodes = $xpath->query('//div[@class="tcell tquick"]');
foreach ($nodes as $node) {
$nome = $xpath->query('div/span/b[@class="the_nome"]', $node)->item(0);
$email = $xpath->query('div/div[@class="c the_email"]', $node)->item(0);
echo $nome->nodeValue . PHP_EOL;
echo $email->nodeValue . PHP_EOL;
}
This will do exactly what you need.