PHP Tutorial: The Raw Post Contents Part 1
|May 16, 2012||Posted by Greg Bulmash under PHP|
There are certain times when you need to retrieve raw post contents rather than getting them from the
$_POST array. This happened to be when I was being fed e-mail addresses that might have a plus in them and found that PHP was automatically running
urldecode() on them. That turns the pluses into spaces, and I needed to differentiate between the two.
That's when I discovered this:
It will return the raw, undecoded post contents. Unfortunately, it doesn't parse them into a nice array and using a function like
parseurl will run
urldecode() on them. So, you'll probably need to use a regular expression to extract the values from the raw post data.