How you should read HTTP_RAW_POST_DATA in PHP

Most people are used to the following global:

On newer servers or servers with globals disabled you will notice that this doesn’t work.
Use the following instead to get the http raw post data.

For more info about this see php.net.

 

In newer versions of PHP you will get the following error message when populating HTTP_RAW_POST_DATA.