Solution for "genrate random number in php with alphabetic"

function generateRandomString($length = 25) { $characters = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ'; $charactersLength = strlen($characters); $randomString = ''; for ($i = 0; $i < $length; $i++) { $randomString .= $characters[rand(0, $charactersLength - 1)]; } return $randomString; } //usage $myRandomString = generateRandomString(5);

php generate random string fixed length

Similar codes for "genrate random number in php with alphabetic"


Latest 'PHP' questions

Added before "genrate random number in php with alphabetic"