What is the potential issue with multiple values in a GET request in PHP?

When multiple values are passed in a GET request in PHP, they are typically received as an array. This can be problematic if the script is not expecting an array and is trying to access a specific value. To solve this issue, you can check if the parameter is an array and handle it accordingly, such as looping through the values or selecting a specific index.

// Check if the parameter is an array and handle it accordingly
if(is_array($_GET['param'])) {
    foreach($_GET['param'] as $value) {
        // Do something with each value
    }
} else {
    $value = $_GET['param'];
    // Do something with the single value
}