Take the file extension from the downloaded file:
$ext = pathinfo($uploaded_filename, PATHINFO_EXTENSION);
Take time before the second: time()
Take some randomness: md5(microtime())
Converting time to base 36: base_convert (time(), 10, 36)- base 36 compresses a 10-byte string to about 6 bytes in order to use more random string to be used
16 char:
$unique_id = substr( base_convert( time(), 10, 36 ) . md5( microtime() ), 0, 16 ) . $ext;
, - - , .