Obviously, all three are used to obtain data sent to the server through http. Php by default can recognize the data type (MIME) is a applicationx-www.form-urlencoded, the common situation is the form of submission, generally submitted data is like k1v1k2v2k3v3 ...... This form-urlencoded. Php parses this data to $
Obviously, all three are used to obtain data sent to the server through http. By default, php recognizes that the data type (MIME) is application/x-www.form-urlencoded, and forms are usually submitted, generally, the data submitted is like k1 = v1k2 = v2k3 = v3 ...... form-urlencoded. Php parses this data to $
Obviously, all three are used to obtain data sent to the server through http.
By default, php can recognize that the data type (MIME) isapplication/x-www.form-urlencoded
The common case is the submission of forms. Generally, the data submitted is likek1=v1&k2=v2&k3=v3......
Form-urlencoded. This data will be parsed by php$_POST
, That is, what we usually use in the form submission operation. However, when the post data is a string in xml format, php cannot parse this data type$_POST
Array, but this will$GLOBALS
Which stores the original post data, that is$GLOBALS['HTTP_ROW_POST_DATA']
In fact$_POST
The data in is analyzed from this array and filled$_POST
(If it cannot be recognized as urlencoded, It is null ).
That is to say, when we want to receive post data in xml format, we can only use$GLOBALS['HTTP_ROW_POST_DATA']
. Of course there is anotherphp://input
This is the IO stream protocol. php will parse this Protocol to post the element data, that isfile_get_contents('php://input')
=$GLOBALS['HTTP_ROW_POST_DATA']
However, when we post binary files to the server, these cannot be identified, suchenctype='multipart/form-data'
This MIME, php provides us$_FILES
Array.
Support MarkDown in CSDN first. Great!