首先把内容编码,再追加\xEF\xBB\xBF
$fp=fopen("text.txt", "w+"); $text = iconv('gb2312', 'utf-8', "中国");// adding header $text="\xEF\xBB\xBF".$text; fputs($fp, $text); fclose($f);
Copyright @ 2024 igaofen Powered by .NET 8.0 on Kubernetes Powered by: .Text and ASP.NET Theme by: .NET Monster