Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to use the php input stream php://input

2025-02-24 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)06/03 Report--

This article introduces the knowledge of "how to use php input stream php://input". In the operation of actual cases, many people will encounter such a dilemma, so let the editor lead you to learn how to deal with these situations. I hope you can read it carefully and be able to achieve something!

The copy code is as follows:

Name:

Age:

Submit the form to the server, which uses file_get_contents to obtain php://input content

The copy code is as follows:

$content = file_get_contents ("php://input")

Echo $content; / / output name=tom&age=22

The description of php://input on the official website repeatedly mentions the variable $HTTP_RAW_POST_DATA, which is actually the same as file_get_contents (php://input). If you want to turn on 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. Using php://input does not require modification of the php configuration file.

Php://input can be used in project applications, such as taking photos with camera, uploading and saving. After the client takes a picture, the picture stream is sent to the server, and the server uses file_get_getcontents ('php://input') to get the picture stream, and then save the picture stream to a file, which is the picture.

This is the end of "how to use the php input stream php://input". Thank you for reading. If you want to know more about the industry, you can follow the website, the editor will output more high-quality practical articles for you!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Development

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report