Trying to get all the title="" vales of an area's but its only picking the the main title of the page. Sample area html:
<area shape="poly" title="Orkney" href="orkney" coords="" />
The page has lots of these and i'm trying to get all the title names My PHP:
function getTextBetweenTags($string, $tagname) {
// Create DOM from string
$html = str_get_html($string);
$titles = array();
// Find all tags
foreach($html->find($tagname) as $element) {
$titles[] = $element->plaintext;
}
return $titles;
}
print_r(getTextBetweenTags($url, 'title'));
All i get is the title of the page, is this the correct way, or can it not be done, thanks for any help :)