说明file_get_contents('php://input') [英] Explain file_get_contents('php://input')

查看:140
本文介绍了说明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屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆