【PHP】Faker実行結果まとめ（日本語もあり）

Fakerのlocaleを日本語で設定した時の実行結果をまとめました。
日本語されていない関数もいくつかありますが参考までに。

# `$faker`のサンプルコード

```php
$faker = Faker\Factory::create("ja_JP");
$faker->title();
```
FYI. [FakerPHP/Fakerドキュメント](https://fakerphp.github.io/)

# fakerチートシート（日本語対応）

## 名前

| 関数名 | サンプルコード | 実行結果 |
|-----------|------------|------------|
| title | `$faker->title('male')` | "Mr." |
| titleMale | `$faker->titleMale()` | "Dr." |
| titleFemale | `$faker->titleFemale()` | "Ms." |
| ~~suffix~~ | ~~`$faker->suffix()`~~ | *※使用不可※* |
| name | `$faker->name('male')` | "石田 陽一" |
| firstName | `$faker->firstName('female')` | "春香" |
| firstNameMale | `$faker->firstNameMale()` | "学" |
| firstNameFemale | `$faker->firstNameFemale()` | "舞" |
| lastName | `$faker->lastName()` | "斉藤" |
| kanaName | `$faker->kanaName('male')` | "ヨシダ ヤスヒロ" |
| lastKanaName | `$faker->lastKanaName()` | "フジモト" |
| firstKanaName | `$faker->firstKanaName('male')` | "ヤスヒロ" |
| firstKanaNameMale | `$faker->firstKanaNameMale()` | "リョウスケ" |
| firstKanaNameFemale | `$faker->firstKanaNameFemale()` | "アケミ" |

## 住所

| 関数名 | サンプルコード | 実行結果 |
|-----------|------------|------------|
| ~~cityPrefix~~ | ~~`$faker->cityPrefix()`~~ | *※使用不可※* |
| secondaryAddress | `$faker->secondaryAddress()` | "コーポ西之園104号" |
| ~~state~~ | ~~`$faker->state()`~~ | *※使用不可※* |
| ~~stateAbbr~~ | ~~`$faker->stateAbbr()`~~ | *※使用不可※* |
| citySuffix | `$faker->citySuffix()` | "市" |
| streetSuffix | `$faker->streetSuffix()` | "町" |
| buildingNumber | `$faker->buildingNumber()` | 106 |
| city | `$faker->city()` | "桐山市" |
| streetName | `$faker->streetName()` | "西之園町" |
| streetAddress | `$faker->streetAddress()` | "木村町中村2-3-2" |
| postcode | `$faker->postcode()` | "6723607" |
| address | `$faker->address()` | "7794097  三重県桐山市中央区伊藤町青山1-9-5" |
| country | `$faker->country()` | "ウルグアイ" |
| latitude | `$faker->latitude(-90,90)` | 54.182262 |
| longitude | `$faker->longitude(-180,180)` | -48.471814 |

## 電話番号

| 関数名 | サンプルコード | 実行結果 |
|-----------|------------|------------|
| phoneNumber | `$faker->phoneNumber()` | "059-212-3357" |
| ~~phoneNumberWithExtension~~ | ~~`$faker->phoneNumberWithExtension()`~~ | *※使用不可※* |
| ~~tollFreePhoneNumber~~ | ~~`$faker->tollFreePhoneNumber()`~~ | *※使用不可※* |
| e164PhoneNumber | `$faker->e164PhoneNumber()` | "+6474582717348" |


## 会社

| 関数名 | サンプルコード | 実行結果 |
|-----------|------------|------------|
| ~~catchPhrase~~ | ~~`$faker->catchPhrase()`~~ | *※使用不可※* |
| ~~bs~~ | ~~`$faker->bs()`~~ | *※使用不可※* |
| company | `$faker->company()` | "株式会社 渡辺" |
| companySuffix | `$faker->companySuffix()` | "Ltd" |
| jobTitle | `$faker->jobTitle()` | "expedita" |


## 文章

| 関数名 | サンプルコード | 実行結果 |
|-----------|------------|------------|
| realText | `$faker->realText(200,2)` | "だってのひとの星座早見せいの高い青年はほんとうに青いアスパラガスの盤ばんうしてはいろにして、そこへ行くといたりラムプシェードをかけたのだ。お母さんの柱はしらがいきなどは向むこうきの降おりのこみました。ジョバンニは、どこに毛がぴんとう」といっていなんてこなんでした。そのままま神かみさまだいていました。ジョバンニの見ず知らずに博士はかせの足おとのあかりの神さまよ」青年は自分で一本あげたり、時々なに問。" |
| ~~realTextBetween~~ | ~~`$faker->realTextBetween(160, 200,2)`~~ | *※使用不可※* |

# fakerチートシート（共通）

## 文字列と数字

| 関数名 | サンプルコード | 実行結果 |
|-----------|------------|------------|
| randomDigit | `$faker->randomDigit()` | 1 |
| randomDigitNot | `$faker->randomDigitNot(2)` | 6 |
| randomDigitNotNull | `$faker->randomDigitNotNull()` | 2 |
| randomNumber | `$faker->randomNumber(5, true)` | 46017 |
| randomFloat | `$faker->randomFloat(1, 20, 30)` | 30.0 |
| numberBetween | `$faker->numberBetween(0, 100)` | 67 |
| randomLetter | `$faker->randomLetter()` | "w" |
| randomElement | `$faker->randomElement(['a', 'b', 'c', 'd', 'e'])` | "c" |
| randomElements | `$faker->randomElements(['a', 'b', 'c', 'd', 'e'], 3)` | ["a", "b", "e",] |
| shuffle | `$faker->shuffle('hello-world')` | "-owlldoelrh" |
|  | `$faker->shuffle([1, 2, 3])` | [3, 1, 2,] |
| numerify | `$faker->numerify('user-####')` | "user-1877" |
| lexify | `$faker->lexify('id-????')` | "id-kpry" |
| bothify | `$faker->bothify('?????-#####')` | "mshfq-36640" |
| asciify | `$faker->asciify('user-****')` | "user-2&Gu" |
| regexify | `$faker->regexify('[A-Z]{5}[0-4]{3}')` | "SFLPX011" |

## 日付と時間

| 関数名 | サンプルコード | 実行結果 |
|-----------|------------|------------|
| unixTime | `$faker->unixTime(new DateTime('+3 weeks'))`| 48668846 |
| dateTime | `$faker->dateTime()`| DateTime @1115945608 {#3555 date: 2005-05-13 09:53:28.0 Asia/Tokyo (+09:00),} |
| dateTimeAD | `$faker->dateTimeAD()`| DateTime @-8583875981 {#3564 date: 1697-12-26 23:19:18.0 Asia/Tokyo (+09:18),} |
| iso8601 | `$faker->iso8601()`| "1982-12-12T05:13:35+0900" |
| date | `$faker->date('Y_m_d')`| "1973_01_28" |
| time | `$faker->time('H_i_s')`| "21_53_34" |
| dateTimeBetween | `$faker->dateTimeBetween('-1 week', '+1 week')`| DateTime @1627518970 {#3531 date: 2021-07-29 09:36:10.0 Asia/Tokyo (+09:00), } |
| dateTimeInInterval | `$faker->dateTimeInInterval('-1 week', '+3 days')`| DateTime @1626851869 {#3555 date: 2021-07-21 16:17:49.0 Asia/Tokyo (+09:00),} |
| dateTimeThisCentury | `$faker->dateTimeThisCentury('+8 years')`| DateTime @500138060 {#3560 date: 1985-11-07 00:14:20.0 Asia/Tokyo (+09:00),} |
| dateTimeThisDecade | `$faker->dateTimeThisDecade('+2 years')`| DateTime @1634277793 {#3531 date: 2021-10-15 15:03:13.0 Asia/Tokyo (+09:00),} |
| dateTimeThisYear | `$faker->dateTimeThisYear('+2 months')`| DateTime @1619314202 {#3555 date: 2021-04-25 10:30:02.0 Asia/Tokyo (+09:00),} |
| dateTimeThisMonth | `$faker->dateTimeThisMonth('+12 days')`| DateTime @1627144082 {#3560 date: 2021-07-25 01:28:02.0 Asia/Tokyo (+09:00),} |
| amPm | `$faker->amPm('+2 weeks')`| "pm" |
| dayOfMonth | `$faker->dayOfMonth('+2 weeks')`| "15" |
| dayOfWeek | `$faker->dayOfWeek('+2 weeks')`| "Sunday" |
| month | `$faker->month('+10 weeks')`| "10" |
| monthName | `$faker->monthName('+10 weeks')`| "March" |
| year | `$faker->year('+10 years')`| "2026" |
| century | `$faker->century()`| "XXI" |
| timezone | `$faker->timezone()`| "America/Mexico_City" |