Home > Backend Development > PHP Tutorial > Why does file creation fail? ?

Why does file creation fail? ?

WBOY
Release: 2016-09-21 14:12:53
Original
1277 people have browsed it

English and numbers are fine. Why not Chinese? How to create Chinese? It doesn’t work even if you try this way$a=iconv("gb2312", "UTF-8", $n).'.txt';

<code>$n='你';
$a=$n.'.txt';
$fopen=fopen($a,'w');</code>
Copy after login
Copy after login

Reply content:

English and numbers are fine. Why not Chinese? How to create Chinese? It doesn’t work even if you try this way$a=iconv("gb2312", "UTF-8", $n).'.txt';

<code>$n='你';
$a=$n.'.txt';
$fopen=fopen($a,'w');</code>
Copy after login
Copy after login

<code>$n="你好";
$a=$n.'.txt';
$a = iconv("UTF-8", "GBK", $a);
$fopen=fopen($a,'w');</code>
Copy after login

I succeeded like this~

No one....

It’s named in Chinese, the demand is too weird, it’s best to avoid Chinese, there are many problems.

Related labels:
php
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