I am wondering how unique is the uniqid() n php?

can I rely on it as a replacement of the typical Guid?

    Well, neither is guaranteed to always be unique -- at least only some versions of GUID are , and uniquid() makes no claims to always be unique (though I suspect if you use the added entropy argument, it's a real long shot you'll get a duplicate unless you are running your system across multiple processors, happen to get two requests that hit their uniqid() calls during the same microsecond on their clocks, and generate the same additional entropy value?)

    But if 100% uniqueness is critical to your needs (as opposed to something like 99.9999...%), then uniqid() may not be the best choice.

      Write a Reply...