How can the $_SERVER['PHP_SELF'] variable be used as an alternative to $PHP_SELF?

Using $_SERVER['PHP_SELF'] as an alternative to $PHP_SELF can help prevent potential security vulnerabilities such as cross-site scripting attacks. By using $_SERVER['PHP_SELF'], you are accessing the same information but in a more secure way. To implement this fix, simply replace all instances of $PHP_SELF with $_SERVER['PHP_SELF'] in your PHP code.

$php_self = $_SERVER['PHP_SELF'];
echo $php_self;