Answer the question
In order to leave comments, you need to log in
How to get og:image value from social networks?
Hello. There was a problem, unable to get the value of the og:image meta tag. The bottom line is that I want to get a photo of a social network user when entering a link to his page. How can this be implemented? I tried parsing, but some social networks do not have this value (such as twitter), and some do not give access to this value (for example, 'vk' gives a 403 error). How can the problem be solved?
Answer the question
In order to leave comments, you need to log in
https://www.php.net/manual/en/function.get-meta-ta...
$tags = get_meta_tags('http://site.com/') + ['og:image' => ''];
echo $tags['og:image'];
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question