What are some alternative methods to access raw HTTP POST data in PHP?

When working with raw HTTP POST data in PHP, the traditional method is to use the $_POST superglobal array to access form data submitted via POST requests. However, in some cases where the data is not in a standard form format (such as JSON or XML), this method may not work as expected. In such situations, alternative methods like reading the raw input stream directly can be used to access the raw HTTP POST data.

// Alternative method to access raw HTTP POST data in PHP
$rawData = file_get_contents("php://input");
$data = json_decode($rawData, true);

// Use $data array to access the decoded raw POST data