Hi
I have this URL:-
http://ask.recipelabs.com/users
and I wish to find the highest page number in the div id 'pager' (in this case it is 7)
I have tried this but it returns zero:
function getusers($url)
{
$doc = new DOMDocument;
$doc->loadhtml($url);
$xpath = new DOMXPath($doc);
$nodelist = $xpath->query('//span[@class="page-numbers"]');
echo 'there are ', $nodelist->length, ' span elements having class="page-numbers"';
}
Is my syntax incorrect? I was then hoping to step through the array and find the highest number.
Thanks
Jonathan