PHP is_uploaded_file() 函数
PHP is_uploaded_file() 函数

定义和用法
is_uploaded_file() 函数检查指定的文件是否是通过 HTTP POST 上传的。
如果文件是通过 HTTP POST 上传的,该函数返回 TRUE。
语法
is_uploaded_file(file)
参数 | 描述 |
---|---|
file | 必需。规定要检查的文件。 |
提示和注释
注释:该函数的结果会被缓存。请使用 clearstatcache() 来清除缓存。
实例
<?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");
}
?>
$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

相关文章
- PHP 教程
- PHP echo 和 print 语句
- PHP 字符串
- PHP 数组排序
- PHP For 循环
- PHP 函数
- PHP 面向对象
- PHP 包含文件 include 和 require 语句
- PHP 文件上传
- PHP 错误处理
- PHP array_diff_ukey() 函数
- PHP array_replace_recursive() 函数
- PHP array_uintersect_uassoc() 函数
- PHP array_values() 函数
- PHP natcasesort() 函数
- PHP sort() 函数
- PHP 5 Directory 函数
- PHP Error 和 Logging 函数
- PHP HTTP 函数
- PHP PDO