1.$_POST and php tutorial: input can get the value, $HTTP_RAW_POST_DATA is empty$_POST organizes the submitted data in an associative array, and encodes it, such as urldecode, and even encoding conversion php: input can also be achieved This function can get the original POST
2. Use curl post to pass json. Our regular $_POST method cannot be accepted. There is a way to accept it, which is to wrap an array around the json data. , you can use file_get_contents("php://input") to receive the post data without including array
3. Simulate a form and take a look:
post.php
echo file_get_contents("php://input");?>
php://input allows reading the raw data of POST . It puts less pressure on memory than $HTTP_RAW_POST_DATA and does not require any special php.ini settings. php://input cannot be used with enctype="multipart/form-data".
php $_POST
$_POST variable is an array whose content is the variable name and value sent by the HTTP POST method.
$_POST variable is used to collect values from the form with method="post". Information sent from a form with the POST method is invisible to anyone (it does not appear in the browser's address bar), and there is no limit on the amount of information sent.
html
welcome.php
Welcome .
You are years old!
Variables sent via HTTP POST will not be displayed in the URL middle.
Variables have no length limit
The above has introduced the difference between php $_POST and php://input, including the relevant content. I hope it will be helpful to friends who are interested in PHP tutorials.