再会,
是否有另一种显示 $zip->getStream 输出而不是 stream_get_contents 的方法,因为 str_replace 不适用于 stream_get_contents,我想在显示之前替换文件中的一些字符串。我目前正在使用
$fp = $zip->getStream($path);
$data = file_get_contents($fp);
if ( $data !== false ) {
echo str_replace("[path]","../mailtemplates/$sql_temp/",$data);
}
但它仍然无法正常工作。
有任何想法吗?
谢谢你。