diff --git a/docs/formatters/numbers-and-strings.md b/docs/formatters/numbers-and-strings.md index 8a0315fb..198d476d 100644 --- a/docs/formatters/numbers-and-strings.md +++ b/docs/formatters/numbers-and-strings.md @@ -114,6 +114,16 @@ echo $faker->randomElement(['a', 'b', 'c', 'd', 'e']); // 'c' ``` +## `randomKey` + +Returns a random key from the given array. + +```php +echo $faker->randomKey(['a' => 1, 'b' => 2, 'c' => 3]); + +// 'b' +``` + ## `shuffle` Returns a shuffled version of either an array or string.