That's a very simple solution to the problem.
If the foile already exists, just fetch a fresh value.
Note: this works because the timestamp generates a new unique number every microsecond.
This would NOT work if you used a random number from a random-number-generator, like mt_rand(), because that generates random numbers, and random != unique.
Random just gives you one value out of Xmillion possibilites, which means it could choose the same number 50 times in a row (unlikely but possible). The more files you have, the bigger the chance of choosing a duplicate filename. This does not happen with timestamps.
A forum, a FAQ, what else do you need?