PHP code example of etelford / faker-instrument-names

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

    

etelford / faker-instrument-names example snippets


$faker = \Faker\Factory::create();
$generator = new \Etelford\InstrumentFaker($faker);
$faker->addProvider($generator);

// Get a random instrument name
echo $faker->instrument;

// Get a random wind instrument name
echo $faker->windInstrument;

// Get a random string instrument name
echo $faker->stringInstrument;

// Get a random percussion instrument name
echo $faker->percussionInstrument;

// Get a random electronic instrument name
echo $faker->electronicInstrument;