Hello,
I'm learning PHP from w3schools.com but they didn't explain everything clearly,
see that page,
http://www.w3schools.com/php/php_file_upload.asp

I want to know the meaning of this line , how it is checking the error in uploading ?

if ($_FILES["file"]["error"] > 0)

Recommended Answers

All 3 Replies

Member Avatar for rajarajan2017

When you upload the file the php will check the file for errors and limitations. The php has come error codes and string formats to check the file errors.

$_FILES["file"]["error"] is used to check for file uploading errors... so if $_FILES["file"]["error"] is greater than zero then its means that there is an error encountered during upload.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.