One-line PHP random string generator?
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 由 翻译 强力驱动 问题: I am looking for the shortest way to generate random/unique strings and for that I was using the following two: $cClass = sha1 ( time ()); or $cClass = md5 ( time ()); However, I need the string to begin with an an alphabet character, I was looking at base64 encoding but that adds == at the end and then I would need to get rid of that. What would be the best way to achieve this with one line of code? Update: PRNDL came up with a good suggestions wich I ended up using it but a bit modified echo substr ( str_shuffle (