just use mt_rand() it is not without reason the "better random value generator"
no need for srand() then On 4 Aug., 09:32, ianh <[email protected]> wrote: > I had a similar issue with rand() not too long ago, it just returned > the same number under all circumstances. From memory, there is a > particular version of PHP with a bug in it that causes this. I forget > where I found this answer now so cannot provide a link I'm afraid. > > I ended up using srand() to fix. > > ianh > > ------------------------ > EventHQ - professional online event registration and > marketinghttp://www.eventhq.co.uk > > On Aug 3, 11:25 pm, Miles J <[email protected]> wrote: > > > I found this very weird bug today, and I am extremely stumped on the > > problem. > > > I was working on a static ad system. The ads are listed in an array > > and I would shuffle() the array and then output the first index as the > > current ad for that request. It works fine locally but online it does > > not. So then I tried using rand(), same problem. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~----------~----~----~----~------~----~------~--~---
