当我搜索上传的临时文件时,我试图返回一个错误。
`
$getID3 = new getID3;
$file = $getID3->analyze($_FILES["file"]["tmp_name"]);
//print_r($file);
if (isset($file['error'])) {
echo $file['error'];
} else {
echo "
<b>Duration:</b> " . $file['playtime_string'] . "<br/>
<b>Dimensions:</b> " . $file['video']['resolution_x'] . "x" . $file['video']['resolution_y'] . "<br/>
<b>Filesize:</b> " . $file['filesize'] . "bytes";
}
`
它存在于数组中,因为当我上传无效的文件类型时,它会返回这个数组。
Array
(
[GETID3_VERSION] => 1.9.12-201602240818
[filesize] => 159924
[filepath] => /tmp
[filename] => phpQAJeuD
[filenamepath] => /tmp/phpQAJeuD
[encoding] => UTF-8
[error] => Array
(
[0] => unable to determine file format
)
)
怎么没有得到['error']
?