我正在编写一个连接到 PHP 网络服务的 android 应用程序,通过我在互联网上的搜索,我遇到了 file_get_contents('php://input');
并且我了解它的某些部分功能但是我还是不明白。什么是 php://input
或 php://stdin
或类似的东西?
我读过 http://php.net/manual/en/function.file-get-contents.php而且我更加困惑。
请完整解释。
最佳答案
信息来自这里:http://www.php.net/manual/en/wrappers.php.php
当信息通过 POST
请求发送到服务器时,它被保存在一个临时文件中。
命令 file_get_contents('php://input')
读取发送到 PHP 的原始信息——在将其放入 $_POST
或 $_REQUEST
super 全局变量。
有人上传文件(例如图片)时经常使用这种技术。
编辑:删除了 $_GET
关于php - 说明 file_get_contents ('php://input' ),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/23304531/