Get Facebook Open Graph(OG) Meta tags with PHP

Today I will show you how to fetch facebook Open Graph(OG) meta tags with php script. Open Graph meta tags are used in html page of website to generate previews of content.when your page is shared on facebook it will capture the og meta tags and generate the snippet.Meta tags are added inside the head tag.

Get Facebook Open Graph(OG) Meta tags

Meta Keywords & their representation as follows,

og:title – The title of your article, excluding any branding.
og:site_name – The name of your website.
og:url – The canonical URL of the page.
og:description – A detailed description of the piece of content

PHP Script

 Usage of Code: