20 Oct

A simple way to create a random password in PHP




## 4 thoughts on “Random Password in PHP”

1. thankz for the code 😀
If I remove rand(4,8) or if I put rand (4,4) then it is generating unique password every second… can we over come it? (may be using something else instead of time() )

2. Try using microtime(). And you can just use 4 instead of rand(4,4). I used that to change the length of password randomly.

3. Thankz Binny.. thatz working 😀

4. Nice snipped – but it is insecure as it will produce passwords only containing [a-f0-9]