Home >Backend Development >PHP Problem >How to use php is_uploaded_file function

How to use php is_uploaded_file function

藏色散人
藏色散人Original
2019-05-25 10:57:542792browse

php is_uploaded_file function is used to determine whether the specified file is uploaded through HTTP POST. Its syntax is is_uploaded_file(file). The parameter file is required and refers to the file to be checked.​

How to use php is_uploaded_file function

How to use the php is_uploaded_file function?

Function: Determine whether the specified file is uploaded through HTTP POST.

Syntax:

is_uploaded_file(file)

Parameters:

file required. Specifies the documents to be checked.

Explanation:

If the file given by file is uploaded via HTTP POST, TRUE will be returned.

php is_uploaded_file() function usage example

<?php
$file = "index.txt";
if(is_uploaded_file($file))
{
    echo "该文件是上传的";
}else{
    echo "该文件不是上传的";
}
?>

Output:

该文件不是上传的

The above is the detailed content of How to use php is_uploaded_file function. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn