gpt4 book ai didi

php://input - 它在 fopen() 中做什么?

转载 作者:行者123 更新时间:2023-12-03 01:07:17 24 4
gpt4 key购买 nike

$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_DATAis not populated by default, it is a potentially less memory intensive alternative to activating always_populate_raw_post_data. php://input is not available with enctype="multipart/form-data".

查看手册:http://php.net/manual/en/wrappers.php.php

关于php://input - 它在 fopen() 中做什么?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7083702/

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