What are the potential issues with using $GLOBALS['HTTP_RAW_POST_DATA'] in PHP scripts, and what alternative method should be used?

Using $GLOBALS['HTTP_RAW_POST_DATA'] in PHP scripts can pose security risks as it is deprecated and can be manipulated by attackers. Instead, the recommended alternative is to use the php://input stream to read raw POST data securely.

// Using php://input to read raw POST data securely
$postData = file_get_contents('php://input');