/ Published in: PHP
just a random string generator function, usefull in captcha building process for example, or in case of random password needed.
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
function randStr($length=6) { $str = ""; $characters = "abcdefghjkmnpqrstwxyz123456789"; if ($length > $maxlength) { $length = $maxlength; } $i = 0; while ($i < $length) { $str .= $char; $i++; } } return $str; }