gpt4 book ai didi

php - 说明 file_get_contents ('php://input' )

转载 作者:塔克拉玛干 更新时间:2023-11-02 19:16:02 25 4
gpt4 key购买 nike

我正在编写一个连接到 PHP 网络服务的 android 应用程序,通过我在互联网上的搜索,我遇到了 file_get_contents('php://input'); 并且我了解它的某些部分功能但是我还是不明白。什么是 php://inputphp://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/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com