What are potential security risks when using global arrays like $_GET in PHP?

Using global arrays like $_GET in PHP can pose security risks such as injection attacks or unauthorized access to sensitive data. To mitigate these risks, it is important to sanitize and validate any input received from global arrays before using them in your application.

// Sanitize and validate input from $_GET before using it
$input_value = isset($_GET['input']) ? htmlspecialchars($_GET['input']) : '';