//This line assigns a random number to a variable. You could also use a timestamp here if you prefer.This code uses the rand () function to generate a random number as the file name. Another idea is to use the time () function so that each file is named after its timestamp. It then combines this name with the extension from the original file. We also assign the subdirectory... make sure this actually exists!
$ran = rand () ;
//This takes the random number (or timestamp) you generated and adds a . on the end, so it is ready of the file extension to be appended.
$ran2 = $ran.".";
//This assigns the subdirectory you want to save into... make sure it exists!
$target = "images/";//This combines the directory, the random file name, and the extension
$target = $target . $ran2.$ext;

