What are the best practices for handling file uploads in PHP to prevent arrays from being cleared?

When handling file uploads in PHP, one common issue is that arrays may get cleared when using the `name` attribute of the file input field as an array. To prevent this, you can use the `[]` notation in the `name` attribute to ensure that multiple file uploads are treated as an array.

<form action="upload.php" method="post" enctype="multipart/form-data">
    <input type="file" name="files[]" multiple>
    <input type="submit" value="Upload">
</form>