...

View Full Version : 16 digit unique number



xiaodao
10-28-2007, 08:19 PM
hello

i am doing image upload, thus i want to rename my images, how can i generate 16digit unique number

GJay
10-28-2007, 08:23 PM
you could use the php function tempnam, which will create a file with a unique filename- though it isnt 16 digits unless you prefix as such: http://uk2.php.net/tempnam

you could use uniqid() which will generate either a 13 or 23 digit number, and pad or trim as you see fit.

You could use some function of the current time (microtime()) to produce 16 digits.

Have you chosen 16 for a reason?

xiaodao
10-28-2007, 08:31 PM
i dont want the image name to be too long, at this moment i am able to get 32 unique number



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum