Heim >Backend-Entwicklung >PHP-Tutorial >PHP如何创建 ANSI 编码文件

PHP如何创建 ANSI 编码文件

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOriginal
2016-06-06 20:28:271914Durchsuche

不是转换文本文件内容,是创建一个ANSI编码的文件。

回复内容:

不是转换文本文件内容,是创建一个ANSI编码的文件。

可以的,一般情况下php创建的文件是Unicode的编码,使用代码如下:<?php file_put_contents('test.txt','abc'); ?>即创建了test.txt文件,文件内容为abc,如要改为ansi编码,需要转换编码file_put_contents('test.txt',iconv('UTF-8','GBK','abc'));

editplus保存时选择ANSI

Stellungnahme:
Der Inhalt dieses Artikels wird freiwillig von Internetnutzern beigesteuert und das Urheberrecht liegt beim ursprünglichen Autor. Diese Website übernimmt keine entsprechende rechtliche Verantwortung. Wenn Sie Inhalte finden, bei denen der Verdacht eines Plagiats oder einer Rechtsverletzung besteht, wenden Sie sich bitte an admin@php.cn