What are some recommended naming conventions for handling multiple file uploads in PHP?

When handling multiple file uploads in PHP, it is recommended to use a naming convention that includes an array notation in the form of "file[]" to ensure each uploaded file is uniquely identified. This allows you to easily loop through the files in the $_FILES superglobal array and process them accordingly.

<form method="post" enctype="multipart/form-data">
    <input type="file" name="file[]" multiple>
    <input type="file" name="file[]" multiple>
    <!-- Add more file input fields as needed -->
    <input type="submit" name="submit" value="Upload">
</form>

<?php
if(isset($_POST['submit'])){
    $total_files = count($_FILES['file']['name']);
    
    for($i=0; $i<$total_files; $i++){
        $file_name = $_FILES['file']['name'][$i];
        $file_tmp = $_FILES['file']['tmp_name'][$i];
        
        // Process each file here
    }
}
?>