PHP code example of vpillinger / php-faker-music

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

    

vpillinger / php-faker-music example snippets




$faker = \Faker\Factory::create();

# For Classical Genre Artists & Albums
$faker->addProvider(new \RauweBieten\PhpFakerMusic\Classical($faker));
echo $faker->musicClassicalArtist . ' - ' . $faker->musicClassicalAlbum . PHP_EOL;

# For Reggae Genre Artists & Albums
$faker->addProvider(new \RauweBieten\PhpFakerMusic\Reggae($faker));
echo $faker->musicReggaeArtist . ' - ' . $faker->musicReggaeAlbum . PHP_EOL;

# For HipHop Genre Artists & Albums
$faker->addProvider(new \RauweBieten\PhpFakerMusic\HipHop($faker));
echo $faker->musicHipHopArtist . ' - ' . $faker->musicHipHopAlbum . PHP_EOL;

# For Metal Genre Artists & Albums
$faker->addProvider(new \RauweBieten\PhpFakerMusic\Metal($faker));
echo $faker->musicMetalArtist . ' - ' . $faker->musicMetalAlbum . PHP_EOL;

# For Dance Genre Artists & Albums
$faker->addProvider(new \RauweBieten\PhpFakerMusic\Dance($faker));
echo $faker->musicDanceArtist . ' - ' . $faker->musicDanceAlbum . PHP_EOL;

composer