What is the potential issue with using global $_GET within a function in PHP?
Using global $_GET within a function in PHP can lead to potential security vulnerabilities, as it allows external input to directly affect the behavior of the function. To solve this issue, you should pass the necessary values from $_GET as parameters to the function instead of relying on global variables within the function.
function process_data($data) {
// Process the data here
}
if(isset($_GET['data'])) {
$data = $_GET['data'];
process_data($data);
}