PHP code example of grom / tube-link

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

    

grom / tube-link example snippets

 php
 php
 php
use TubeLink\TubeLink;

$url = 'http://youtu.be/kffacxfA7G4';

$parser = new TubeLink();
$parser->registerService(new \TubeLink\Service\Youtube());

$tube = $parser->parse($url);

// Shows the embedded video HTML
echo $tube->render();

// Return the thumbnail
echo $tube->thumbnail();