What is the correct syntax for accessing the PHP_SELF variable in PHP code?

When accessing the `PHP_SELF` variable in PHP code, it is important to use it in a secure manner to prevent potential security vulnerabilities such as cross-site scripting attacks. To access the `PHP_SELF` variable safely, it is recommended to use `htmlspecialchars()` function to sanitize the input and prevent any malicious code injection.

$php_self = htmlspecialchars($_SERVER['PHP_SELF']);
echo $php_self;