PHP code example of quangtam / opengraph

1. Go to this page and download the library: Download quangtam/opengraph 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/ */

    

quangtam / opengraph example snippets


  'providers' => array(
      ....
      quangtam\OpenGraph\Providers\OpenGraphProvider::class,
  ),
  

  'aliases' => array(
      ....
      'OGMeta' => quangtam\OpenGraph\Facades\OpenGraphFacade::class
  ),
  

  $data = OGMeta::fetch("https://unsplash.com/", true);
  

  $url = "https://ogp.me",
  $allMeta = true, // can be false
  $language = 'en' // en-US,en;q=0.8,en-GB;q=0.6,es;q=0.4
  $data = OpenGraph::fetch($url, $allMeta, $language);