i dont know how to generate pins..that will be inserted on the registration page ..that if the registration was pass it will be put on the field of `pins`.. thanks in advance ..
How can i generate a random pin about 8 alphanumeric pins..?
Collapse
X
-
Tags: None
-
One way is a simple function that takes the length you want and the acceptable characters, something like this
Hope that helpsCode:function GenerateRandom($length, $charset='ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789') { $randString = ''; $count = strlen($charset); while ($length--) { $randString .= $charset[mt_rand(0, $count-1)]; } return $randString; }
Comment