Agree with erickson, just can advise you to use
pwgen -1 -s
command on * nix, which will do better any procedure you can think of.
If you want to generate some string programmatically, you can take a look at
<?php $better_token = md5(uniqid(rand(),1)); ?>
this gives a very good level of randomness and before collisions.
If you need an even higher level of security, you can consider generating random sequences at http://www.random.org/
Igor
source share