wiki/content/20201116142317-fromrandom.md

18 lines
357 B
Markdown
Raw Permalink Normal View History

2024-05-06 20:40:05 +00:00
---
2024-10-30 17:34:11 +00:00
date: 2020-11-16
2024-05-06 20:40:05 +00:00
id: 84047ab5-ea5d-4ebe-9ea4-8a89d0a8cc22
title: fromRandom()
---
# Description
Generates random alphanumeric strings
# Syntax
``` php
$random = ByteString::fromRandom(6); // 'g6UkL2'
$randomPin = ByteString::fromRandom(4, '0123456789'); // '7385'
$randomKey = ByteString::fromRandom(1, 'WASD'); // 'S'
```