I want to upload multiple files in php. I've on file input box and beside it i've add more button. when user clicks on button new file upload will come. user should be able to upload only five files if five file uploads control will come using add more then alert will come and user can not add another file upload. Now if i am selecting all five files and printing $\_FILES array it is showing file name for first and last array index. Code given below:-

```
 Array
(
    [txtProductImage] => Array
        (
            [name] => Array
                (
                    [0] => 14200127851.jpg
                    [1] => 
                    [2] => 
                    [3] => 
                    [4] => 14200127864.jpg
                )

            [type] => Array
                (
                    [0] => image/jpeg
                    [1] => 
                    [2] => 
                    [3] => 
                    [4] => image/jpeg
                )

            [tmp_name] => Array
                (
                    [0] => C:\xampp\tmp\phpBCCE.tmp
                    [1] => 
                    [2] => 
                    [3] => 
                    [4] => C:\xampp\tmp\phpBCDF.tmp
                )

            [error] => Array
                (
                    [0] => 0
                    [1] => 4
                    [2] => 4
                    [3] => 4
                    [4] => 0
                )

            [size] => Array
                (
                    [0] => 575185
                    [1] => 0
                    [2] => 0
                    [3] => 0
                    [4] => 660387
                )

        )

)

```

I'd spent lots of time but could not able to get what the issue is. Any help will be appreciated. Thanks in advance