$handle = fopen("/home/rasmus/file.txt", "r");
$handle = fopen("/home/rasmus/file.gif", "wb");
我可以理解,/home/rasmus/file.txt
和/home/rasmus/file.gif
是文件路径。
但是这些意味着什么:
php://input
php://temp
在
$objInputStream = fopen("php://input", "r");
$objTempStream = fopen("php://temp", "w+b");
他们是做什么的?
最佳答案
php://input
is a read-only stream that allows you to read raw data from the request body. In the case of POST requests, it is preferable to$HTTP_RAW_POST_DATA
as it does not depend on special php.ini directives. Moreover, for those cases where$HTTP_RAW_POST_DATA
is not populated by default, it is a potentially less memory intensive alternative to activatingalways_populate_raw_post_data
. php://input is not available withenctype="multipart/form-data"
.
关于php://input - 它在 fopen() 中做什么?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7083702/