How can the $_FILES superglobal be used to troubleshoot file upload issues in PHP?

When troubleshooting file upload issues in PHP, you can use the $_FILES superglobal to check for errors and retrieve information about the uploaded file. You can access details such as file name, file type, file size, and temporary file location. By examining these values, you can identify any potential issues with the file upload process and make necessary adjustments to your code.

if ($_FILES['file']['error'] > 0) {
    echo "Error: " . $_FILES['file']['error'];
} else {
    move_uploaded_file($_FILES['file']['tmp_name'], "uploads/" . $_FILES['file']['name']);
    echo "File uploaded successfully!";
}