PHP code example of a-yasui / faker-addon
1. Go to this page and download the library: Download a-yasui/faker-addon 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/ */
a-yasui / faker-addon example snippets
// コード例
$faker = \Faker\Factory::create();
$faker->addProvider(new \Ayasui\AddOn\Provider\Japanese($faker));
// ひらがな
echo $faker->hira_gana; // あ
echo $faker->hira_gana(10); // たろがぬべにぽぞやも
// 全角ひらがな
echo $faker->zenkaku_hira_gana; // ゔ
echo $faker->zenkaku_hira_gana(10); // うからこぶぼわえぞぞ
// 全角ひらがな(フル)
echo $faker->full_zenkaku_hira_gana(10); // づとぉそぎだぢけめゎ
// カタカナ
echo $faker->kata_kana; // ツ
echo $faker->kata_kana(10); // オカデウオツズグガネ
// 半角カタカナ
echo $faker->han_kata_kana(10); // ユココヲルラスメケク
echo $faker->full_han_kata_kana(10); // サェキチァムゥレヒテ
// アルファベット
echo $faker->alphabet; // A
echo $faker->alphabet_with_number(10); // Z2cOfHAGJr
// 全角アルファベット
echo $faker->zenkaku_alphabet(10); // BXEdwgYgKK
echo $faker->zenkaku_alphabet_with_number(10); // JUF8U0jjUZ