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

How to use php is_uploaded_file function

藏色散人
Release: 2023-02-22 18:40:02
Original
2772 people have browsed it

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)
Copy after login

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 "该文件不是上传的";
}
?>
Copy after login

Output:

该文件不是上传的
Copy after login

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!

Related labels:
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template