Home > Backend Development > PHP Tutorial > 生成文件名时,生成目录名时 乱码现象

生成文件名时,生成目录名时 乱码现象

WBOY
Release: 2016-06-23 14:08:43
Original
1105 people have browsed it


$ming="名字"$weizhi=fopen("../dowtxt/$xsming.txt","a");
Copy after login


提示这个,页面输出和打印正常。

生成出来后成这个样 绌胯??ょ?绂??.txt

执行上代码文件在 /a/1.php里。

生成就上上目录下的dowtxt里了。


回复讨论(解决方案)

然后再执行生成fwrite($weizhi,"$neirong");
Copy after login

你在简体中文(gbk)的操作系统中,使用 utf-8 的文件名,不乱码才怪呢

        $xsming=iconv("UTF-8","GBK",$xsming);

source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template