Is this what you are looking for?
You could try SimpleHTMLDOM. You can then run something like...
$html = new simple_html_dom();
$html->load_file('fileToParse.html');
$count=0;
foreach($html->find('fb:like') as $element){
$count+=1
}
echo $count;
That should work.
I looked a bit further and found this. I took this from the DOMDocument on PHP.net.
$dom = new DOMDocument;
$dom->loadHTML('fileToParse.html'); // or $dom->loadXML('fileToParse.html');
$likes = $dom->getElementsByTagName('fb:like');
$count=0;
foreach ($likes as $like) {
$count+=1;
}
After this one I am stuck
$file=file_get_contents("other.html");
$search = '/<fb:like[^>]*>/';
$count = preg_match_all($search , $file, $matches);
echo $count;
//Below is not needed
print_r($matches);
That however is RegEx and is quite slow. I Tried:
$dom = new DOMDocument;
$xpath = new DOMXPath($dom);
$dom->load("other.html");
$xpath = new DOMXPath($dom);
$rootNamespace = $dom->lookupNamespaceUri($dom->namespaceURI);
$xpath->registerNamespace('fb', $rootNamespace);
$elementList = $xpath->query('//fb:like');
But got the same error as you.