PHP code example of aalaap / faker-youtube

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

    

aalaap / faker-youtube example snippets


# When installed via composer
ate();
$faker->addProvider(new \Faker\Provider\Youtube($faker));

echo $faker->youtubeUri();
// https://www.youtube.com/watch?v=KyXYWQ-B3zO

echo $faker->youtubeShortUri();
// https://youtu.be/watch?v=rsPyiZSzj3g

echo $faker->youtubeEmbedUri();
// https://www.youtube.com/embed/aUgKvcNS6en

echo $faker->youtubeEmbedCode();
// <iframe width="560" height="315" src="https://www.youtube.com/embed/aUgKvcNS6en" frameborder="0" gesture="media" allow="encrypted-media" allowfullscreen></iframe>

echo $faker->youtubeRandomUri();
// https://youtu.be/watch?v=lctkDb05MKT