No, this is not possible with tempnam. You will need to write your own function for this, for example, using the current time. The problem here is to avoid race conditions, but this can be resolved by including the PID in the file name, for example:
do { $filename = rand(); $filename .= '.'. str_replace(' ', '.', microtime()); $filename .= '.'. getmypid(); $filename .= '.pdf'; } while(file_exists($filename));
If the directory is shared between different machines, the PID is not guaranteed to be unique. In this case, also specify the host name of the current computer (as specified by gethostname).
source share