PHP code example of nonz250 / php-simple-ogp
1. Go to this page and download the library: Download nonz250/php-simple-ogp library. Choose the download type require. 2. Extract the ZIP file and open the index.php. 3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
nonz250 / php-simple-ogp example snippets
$ogp = new \SimpleOgp\SimpleOgp('https://labo.nozomi.bike');
// Get web site content and set ogp values.
$ogp->getHtml();
// Get ogp title.
$title = $ogp->title();
// Get ogp description.
$description = $ogp->description();
// Get ogp image path.
$imagePath = $ogp->imagePath();