How to get data from this ?
<td align="right" width="100"><span class="statsTopHi">1,234,567</span></td>
I need to get statsTopHi data? but dont know how to do it, i'm new to php and dont know anything about curl.
<?php
$handle = curl_init();
curl_setopt($handle, CURLOPT_URL, "my url");
curl_setopt($handle, CURLOPT_RETURNTRANSFER, true);
$html = curl_exec($handle);
curl_close($handle);
$DOM = new DOMDocument;
$DOM->loadHTML($html);
//get all span
$items = $DOM->getElementsByTagName('span');
//display all span text
for ($i = 0; $i < $items->length; $i++)
echo $items->item($i)->nodeValue . "<br/>";
?>
Using this i parse all span content, but need to get only class="statsTopHi"