How can I know a number of uploaded files with PHP?
I have a form with several input type="file" tags. How can I know on the server side amount of files uploaded by the user. He can upload 3 files, or may be 5 files, 1 or even nothing. I need to know how much files user have uploaded. Sandeepan Nath If you are having input upload tags with name like file1 , file2 then if($_FILES['file1']['size'] > 0) echo "User uploaded some file for the input named file1" Now for many files (looking at the output you are having), run a foreach loop like this:- $cnt=0; foreach($_FILES as $eachFile) { if($eachFile['size'] > 0) $cnt++; } echo $cnt." files