PHP code example of astrotomic / php-open-graph
1. Go to this page and download the library: Download astrotomic/php-open-graph 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/ */
astrotomic / php-open-graph example snippets
use Astrotomic\OpenGraph\OpenGraph;
use Astrotomic\OpenGraph\StructuredProperties\Image;
echo OpenGraph::website('Example')
->url('https://example.com')
->image('https://example.com/image1.jpg')
->image(Image::make('https://example.com/image2.jpg')->width(600));
bash
composer