PHP code example of affinity4 / faker

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

    

affinity4 / faker example snippets


$faker = \Faker\Factory::create();
$faker->addProvider(new \Affinity4\Faker\en_IE\Address\Address($faker));

$faker->address(); // 123C Pearse Heights, Arklow, Galway, Ireland, V50 Z9U1

$faker->buildingNumber(); // 123C Pearse Heights, Arklow, Galway, Ireland, V50 Z9U1

$faker->buildingNumber(); // 123 or 123C

$faker->street(); // Pearse Heights

$faker->town(); // Arklow

$faker->county(); // Galway

// or...
$faker->county(with_prefix: true); // Co. Galway

$faker->province(); // Connacht

$faker->country(); // Ireland

$faker->eircode(); // V50 Z9U1

// or...
$faker->eircode(with_spaces: false); // V50Z9U1

$faker->eircode(allow_existing_routing_keys: false); // Z99 Z9U1