PHP code example of lapalabs / youtube-helper

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

    

lapalabs / youtube-helper example snippets

 php
YoutubeResource::getValidHosts(); // array of valid YouTube resource URLs
 php
YoutubeResource::isValidId('5qanlirrRWs'); // return true if ID is valid
YoutubeResource::isValidHost('youtu.be');  // return true if host is valid
 php
[
    'width'           => 560,
    'height'          => 315,
    'src'             => '', // hold position for specific order
    'frameborder'     => 0,
    'allowfullscreen' => null,
];