4
strrand
strrand
SYNOPSIS
strrand($charset, $len)
DESCRIPTION
CODE
- function strrand($charset, $len) {
- $max=strlen($charset)-1;
- $s = '';
- srand();
- for ($i=0; $i < $len; $i++) {
- $s .= $charset[rand(0, $max)];
- }
- return $s;
- }
strrand($charset, $len)
Commentaires