PHP code example of skeeks / youtube-helper
1. Go to this page and download the library: Download skeeks/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/ */
skeeks / youtube-helper example snippets
$youtube = new \skeeks\youtubeHelper\YoutubeHelper('https://www.youtube.com/watch?v=xr1kXiEtCmo');
$youtube = new \skeeks\youtubeHelper\YoutubeHelper('https://youtu.be/xr1kXiEtCmo');
$youtube = new \skeeks\youtubeHelper\YoutubeHelper('<iframe width="640" height="360" src="https://www.youtube.com/embed/xr1kXiEtCmo?rel=0&controls=0&showinfo=0" frameborder="0" allowfullscreen></iframe>');
if ($youtube->getId())
{
print_r($youtube->getId());
print_r($youtube->getEmbedUrl());
print_r($youtube->getImageUrl());
print_r($youtube->getWatchUrl());
} else
{
print_r('Parsing code error');
}
$youtube = new \skeeks\youtubeHelper\YoutubeHelper('https://www.youtube.com/watch?v=xr1kXiEtCmo');
if ($youtube->getId()
{
echo '<iframe width="560" height="315" src="<?= $youtube->getEmbedUrl();
php composer.phar