例如我想上传文件名moble.jpg,我想像XXDSSDFS.jpg一样存储它我尝试使用pathinfo但是当我print_r它什么也没有返回时,我想我应该像jpg或png一样返回。 注意假设我上传2 img
$text = $_POST['spec_text'];
$file_spec = $_FILES['spec_file']['name'];
$typefile = $_FILES['spec_file']['type'];
$sizefile = $_FILES['spec_file']['size'];
$filename = md5($_FILES['spec_file']['tmp_name']);
$a = count($file_spec);
for ($i=0; $i < count($file_spec); $i++) {
if ($typefile[$i] == 'image/png' OR $typefile[$i] == 'image/jpeg')
{
echo "string".$filename;
}else{
echo "eror";
}
}