Php input stream: Analysis of input usage, input stream input. Php input stream: Analysis of input usage, input stream input is used to take a camera photo and then upload the function, php uses php: input to obtain the content. So I learned about php: input. Php input stream: // analysis of input, input stream input
In php, you can use php: // input to obtain the content after taking a camera photo and uploading it. So I learned about php: // input.
From the official website information, php: // input is a read-only information stream. when the request method is post and enctype is not equal to "multipart/form-data", you can use php: // input to obtain the data of the original request.
Let's look at a simple example.
The client is a form, which is very simple.
The code is as follows:
Submit the form to the server. the server uses file_get_contents to obtain the php: // input content.
The code is as follows:
$ Content = file_get_contents ("php: // input ");
Echo $ content; // Output name = tom & age = 22
The $ HTTP_RAW_POST_DATA variable is repeatedly mentioned in the php: // input description on the official website. The variable actually has the same content as file_get_contents (php: // input. To enable this variable, you need to modify the configuration file, find the always_populate_raw_post_data option, set it to On, and then restart the web server. Php: // input does not need to modify the php configuration file.
Php: // input can be used in project applications, such as camera photos, upload and save. After taking a photo from the client and sending the image to the server, the server can use file_getcontents ('php: // input') to get the image stream and save the image stream to a file, this file is an image.
Which of the following statements about file_get_contents ("php: // input") in php?
Read the php input stream to a string, which is different from $ _ post and $ _ GET. for details, see manual.
Save php: // input
$ Content = file_get_contents ("php: // input ");
File_put_contents('a.txt ', $ content );
Ghost is working on a camera to take a photo and then upload it. php: // input is used in php to obtain the content. So I learned about php: // input ....