OpenGraph is a helper class for generating Open Graph meta tags.
Use the package manager Composer to install OpenGraph.
composer require apility/opengraph
use Apility\OpenGraph\OpenGraph;
$og = new OpenGraph;
$og->addProperty('title', 'Hello World');
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<?php print($og->toMetaTags()); ?>
<title>Document</title>
</head>
<body>
<h1>Hello World</h1>
</body>
</html>