PHP - How to save text file with ANSI encoding?
问题 I'm doing: file_put_contents("txt/myfile.txt", $fileContents); I have tried many ways to force my text file to be ANSI, like: $fileContents = mb_convert_encoding($fileContents , mb_detect_encoding($fileContents , mb_detect_order(), true), 'WINDOWS-1252'); I have also tried: $fileContents = iconv("ISO-8859-1", "WINDOWS-1252", $fileContents ); I need ANSI because the text file should look nice when I open it with the "type" command from MS-DOS (cmd.exe in Windows 7) If I open my current file I