hey all i have been trying to get the ext from a file so that i can append it back on. but it seems not to be working here is what i have tried
$tempFile = $_FILES["Filedata"]["tmp_name"];
$targetPath = $_POST["path"];
$filename = $tempFile;
$filename=str_replace(" ","_",$filename);// Add _ inplace of blank space in file name, you can remove this line
$ext = substr(strrchr($filename, '.'), 1);
$ext2 = '.'.$ext;
$randName = md5(rand() * time());
$filename = $randName . '.' . $ext;
echo $filename;
all it does is gives it the random name and adds the . with not ext added back on