Generating random string of fixed length

I want to generate a 6 character long unique key in php in which first 3 should be alphabets and next 3 should be digits.I know about the uniqid() function but it generates 13 characters long key and also it wont fit in my requirement as I need first 3 characters as alphabets and next 3 as numbers.Any way in which I can modify uniqid() to fit in my requirements?

Source: php

Leave a Reply