gpt4 book ai didi

php://输出无效

转载 作者:行者123 更新时间:2023-12-04 05:10:12 24 4
gpt4 key购买 nike

我将生成一个 csv 文件到 php 输出,以便用户可以立即下载它:

header( 'Content-Type: text/csv' );
header( 'Content-Disposition: attachment; filename=' . $filename );
$fp = fopen('php://ouput', 'w'); // Here is where error happens, line 156
if(!$fp) var_dump($fp); // output: bool(false)

但它会产生以下错误:
Warning: fopen(): Invalid php:// URL specified in /home/mustafa/xxx/includes/functions.php on line 156
Warning: fopen(php://ouput): failed to open stream: operation failed in /home/mustafa/xxx/includes/functions.php on line 156

为什么 php://output无效

最佳答案

改变这个

$fp = fopen('php://ouput', 'w');


$fp = fopen('php://output', 'w');
^ // you missed `t`

关于php://输出无效,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/14977344/

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