时间:2021-07-01 10:21:17 帮助过:8人阅读
中文问题吧
$str="宋1.txt";$str=iconv("utf-8", "GBK", $str);//注释掉就会失败$fp = fopen($str, "a");if(fwrite($fp,"losasds")!==false) echo "ok";else echo "fail";fclose($fp);
二进制文件要用二进制方式打开,即模式中要有 b
中文问题吧
$str="宋1.txt";$str=iconv("utf-8", "GBK", $str);//注释掉就会失败$fp = fopen($str, "a");if(fwrite($fp,"losasds")!==false) echo "ok";else echo "fail";fclose($fp);