dsagzmosl32217092 2012-06-24 21:23
浏览 66
已采纳

PHP绝对独特,随机字符串

Is there any php function in our time, which generates absolutely unique, random string? Or rephrase the question, how to make absolutely unique and random string in php in our time? Is it enough to combine couple of randomizing functions?

  • 写回答

1条回答 默认 最新

  • douran7929 2012-06-24 21:30
    关注

    Just to be nitpicky... If it has to be unique then it's not really "random". Randomness includes the possibility of duplication, since generating a random state doesn't depend on (or refer to) previous states.

    Do you just want to create a GUID? PHP has a couple methods for generating random IDs:

    Some other people have also found ways to do this, it seems.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
编辑
预览

报告相同问题?

手机看
程序员都在用的中文IT技术交流社区

程序员都在用的中文IT技术交流社区

专业的中文 IT 技术社区,与千万技术人共成长

专业的中文 IT 技术社区,与千万技术人共成长

关注【CSDN】视频号,行业资讯、技术分享精彩不断,直播好礼送不停!

关注【CSDN】视频号,行业资讯、技术分享精彩不断,直播好礼送不停!

客服 返回
顶部