swuppio/randstring
最新稳定版本:1.0.0
Composer 安装命令:
composer require swuppio/randstring
包简介
Generate random string
README 文档
README
This package was created for my personal use, but if you find it useful, feel free to use it
It helps generate random strings
Installation
Via Composer
composer require swuppio/randstring
Get Started
Params description
gen(int $length = 5, ?string $symbols = null): string
- int
$length- The desired length of the generated random string. Specifies how many characters the resulting string should contain (default = 5) - ?string
$symbols- An optional string of characters from which the random string will be generated. If not provided, the method will use a default set of characters returned by thegetChars()method
The method returns a randomly generated string
Example
Generate a random string using default parameters:
echo RandString::gen();
Generate a 10-character long random string using a custom set of characters:
echo RandString::gen(10, 'abc123');
统计信息
- 总下载量: 3
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 1
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2024-02-23