function get_og_tags($url)
{
$dom = new DOMDocument('1.0', 'UTF-8');
@$dom->loadHTMLFile($url);
$result = [];
foreach ($dom->getElementsByTagName('meta') as $node) {
$prop = $node->getAttribute('property');
if (substr($prop, 0, 3) !== 'og:') continue;
$result[$prop] = $node->getAttribute('content');
}
return $result;
}
$ogs = get_og_tags('https://wallacemaxters.com.br');
print_r($ogs);
Top comments (0)