检查指定文件名是否通过HTTP POST上传:
<?php
$file = "test.txt";
if(is_uploaded_file($file)) {
echo ("$file is uploaded via HTTP POST");
} else {
echo ("$file is not uploaded via HTTP POST");
}
?>
上面代码的输出可能是:
test.txt is not uploaded via HTTP POST
is_uploaded_file() 函数检查指定的文件是否通过 HTTP POST 上传。
is_uploaded_file(
file)
Parameter | Description |
---|---|
file | Required. Specifies the path to the file to check |
返回值: | 如果文件通过 HTTP POST 上传则为 TRUE,如果失败则为 FALSE |
---|---|
PHP 版本: | 4.0.3+ |
截取页面反馈部分,让我们更快修复内容!也可以直接跳过填写反馈内容!