RandomString
A simple class for generating random strings.
Create RandomString Instance
use Didatus\RandomString\RandomString;
$randomString = new RandomString();
Create RandomString Instance with own character pool and with excluding characters
use Didatus\RandomString\RandomString;
$randomString = new RandomString('0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ', '1IO0');
Excluding characters can be helpful for generating readable coupons (without confusing 0 and O for example).
Generate a single random string
$randomString = new RandomString();
$string = $randomString->getString(10);
Generate a single random alpha numeric string excluding confusing characters
$randomString = new RandomString('0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ', '1IO0');
$string = $randomString->getString(10);
generate a list of five random tokens
$randomString = new RandomString();
$strings = $randomString->getListOfString(10, 5);
C8H5