What is the difference between using $REMOTE_ADDR and $_SERVER["REMOTE_ADDR"] in PHP scripts?

Using $REMOTE_ADDR is a deprecated way of accessing the remote IP address of the client in PHP. It is recommended to use $_SERVER["REMOTE_ADDR"] instead to retrieve the remote IP address securely. This ensures compatibility with newer PHP versions and follows best practices for accessing server variables.

$remote_ip = $_SERVER["REMOTE_ADDR"];
echo "Remote IP Address: " . $remote_ip;