从许多<td>标签的html字符串中获取值[重复]

This question already has an answer here:

I have a string below

<?php
$str = '<td>1.06</td><td>9.30</td><td>16.08</td><td style="color:#009">0.70</td><td style="color:#009">3/3.5</td><td style="color:#009">1.00</td><td><font color="blue">L</font></td>';
?>

What function help us to get value of each < TD > tag and putting them into an array . Thank friends.

</div>

Use php DomDocument

$dom = new DOMDocument();
$dom->loadHTMLFile("test.html");
$tables = $dom->getElementsByTagName('table');   

foreach ($table->childNodes as $td) {
  if ($td->nodeName == 'td') {
    echo $td->nodeValue, "
";
  }
}