说明file_get_contents('php://input') [英] Explain file_get_contents('php://input')
问题描述
我正在编写一个Android应用程序以连接到PHP Web服务,并且通过在互联网上进行搜索,我遇到了 file_get_contents('php://input');
,并且我理解了其中部分功能,但是我还是不明白.什么是 php://input
或 php://stdin
或类似的东西?我已阅读 http://php.net/manual/zh/function.file-get-contents.php ,而我感到更加困惑.
I am writing an android app to connect to PHP web service and through my searches in internet I faced file_get_contents('php://input');
and I understood some parts of it's functionality but I still don't get it. What are php://input
or php://stdin
or stuff like that?
I've read http://php.net/manual/en/function.file-get-contents.php and I confused much more.
请完整解释.
推荐答案
信息来自此处: http://www.php.net/manual/en/wrappers.php.php
当信息通过 POST
请求发送到服务器时,它被保存在一个临时文件中.
When information is sent to the server via a POST
request, it is saved in a temporary file.
命令 file_get_contents('php://input')
读取发送到PHP的原始信息-在将其放入 $ _ POST
或 $ _ REQUEST
超级全局变量.
The command file_get_contents('php://input')
reads the raw information sent to PHP -- unprocessed before it ever gets put into $_POST
or $_REQUEST
super globals.
当某人上传文件(例如图像)时,通常使用此技术.
This technique is often used when someone is uploading a file, such as an image.
删除了 $ _ GET
removed $_GET
这篇关于说明file_get_contents('php://input')的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!