Equivallent for $_SERVER['argv'] when using $_POST?
I'm wondering if there is a $_POST
equivallent for $_SERVER['argv']
, which only works with $_GET
.
This is because my ajaxscript recently changed from $_GET
to $_POST
due to IE7 issues but the query passed into the ajaxfunction is quite long.
So if there is a simple alternative rather than to reconstruct the $_开发者_开发知识库GET
string from a $_POST
array that would be nice :)
Yes, you can read the raw POST body like so
$postBody = file_get_contents( 'php://input' );
There's no way I can find to get the actual POST string, but it's pretty easy to construct it.
$poststring = http_build_query($_POST);
精彩评论