How can PHP Snippet Plugins and $_GET parameters be used for hacking servers if variables are not sanitized?

If PHP Snippet Plugins and $_GET parameters are not sanitized, hackers can inject malicious code into the server, leading to security vulnerabilities and potential data breaches. To prevent this, it is crucial to sanitize all user input before using it in PHP code.

// Sanitize the $_GET parameter before using it in PHP code
$param = filter_input(INPUT_GET, 'param', FILTER_SANITIZE_STRING);