galvao / random-string
A Random String generator based on character classes, with the possibility of excluding specific characters.
dev-master
2015-12-28 15:00 UTC
Requires
- php: >=5.3.0
This package is auto-updated.
Last update: 2025-04-29 00:50:25 UTC
README
A Random String generator based on character classes, with the possibility of excluding specific characters.
END OF LIFE
As of PHP7 there are far better (and native!) ways of generating random data. Please check http://php.net/manual/en/ref.csprng.php
This repo will remain as example material.
Usage
<?php use RandomString\RandomString; // Generates a 12 character string with lowercase letters and symbols, excluding the backslash and pipe chracters. $str = new RandomString(12, array('lowerCase', 'symbols'), array('\\', '|')); echo $str->result;