Created
July 24, 2010 17:04
-
-
Save anonymous/488815 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require_once('simple_html_dom.php'); | |
$example = <<<XML | |
<div class="local-tabs"> | |
<div class="local-tab active">Set1 <span class="searchresults_tab_number">(3869)</span></div> | |
<div class="local-tab"><a href="#">Set2 <span class="searchresults_tab_number">(1)</span></a></div> | |
<div class="local-tab"><a href="#">Set3 <span class="searchresults_tab_number">(3870)</span></a></div> | |
</div> | |
XML; | |
$html = new simple_html_dom(); | |
$html->load($example); | |
foreach($html->find('span[class=searchresults_tab_number]') as $element) { | |
echo $element->innertext . '<br />'; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment