Dear Sir/Madam,

We have our uniqid("") works perfectly in our current Linux server. Each returns unique ID as we expected.
When we deploy the same code to Windows Server 2003, we found that the uniqid("") returns the same value.

I've searched some solution and it encourage me to use uniqid("", true) instead of uniqid("").
My question is, is there a simpler way says configure in php.ini instead of changing the coding to my entire system?

Or i should do something to my windows system time, or microtime to make the uniqid() behaves similar as Linux?

    AS near as I can tell, this is simply a Windows problem, and you will need to to use uniqid("", true).

    As Cygwin runs on the Windows platform:

    PHP Manual wrote:

    Note:

    Under Cygwin, the more_entropy must be set to TRUE for this function to work.

    I think (but I am not an expert), that this is due to granularity differences between the POSIX/UNIX gettimeofday() and clock_gettime(), and the Windows GetSystemTime() and GetSystemAsFileTime(). POSIX is, at a minimum, 100 times more precise.

      Write a Reply...