misc
is a simple class that basically just exposes some handy functions. Currently there is only one function, but this is where I will put the others as I create them. Think of it as a namespaced function library.
Parent Class
None
Static Methods
Parameters:
$length
(int) How long of a string you want (including the prefix if any) Default: 64$prefix
(string) A string to prepend to the start of the random string. The length of the prefix is considered when creating the random string. ie: If you specify the string you want to be 20 characters and the prefix is 10 characters, then there will only be 10 more random characters$characterPool
(string) the characters to use in creating the random string Default: ABCDEFGHJKMNPQRSTUVWXYZabcdefghjkmnpqrstuvwxyz23456789Returns:
a random string of characters
Example:
1 |
echo \ipinga\misc::randomString(5); // could output something like 'Ap74d' |