将变量随时间设置为随机使用

If I set a variable as follows:

$randNum = md5(time());

and use that to create:

$tempFileName = $randNum.'_temp.'.$type;

and then, later in the script:

$newFileName = $randNum.'_new.'.$type;

Will it be generating a new random number the second time around or will $randNum value be the same as the 1st?

The $randnum value will be the same as the first. If in doubt just test it:

$randNum = md5(time());
echo $randNum;
sleep(5);// sleep for 5 seconds
echo $randNum;

The values will be the same.

Try this,

$newFileName = $randNum.'_new.'.$type;

instead of

$newFileName == $randNum.'_new.'.$type;

output:

87bc7ff76220f988dd191bd804482bff_temp.
87bc7ff76220f988dd191bd804482bff_new.