trouble in mkdir with Chinese characters on window + xampp

十年热恋 提交于 2019-12-12 02:25:26

问题


I am trying to create a folder with name 测试 on xampp installed on my windows computer.

$new    =   "测试";
mkdir("test/$new");

It creates folder but the folder name is 测试 not 测试.

Please help


回答1:


Try this:

$new    =   mb_convert_encoding("测试", 'CP936', 'UTF-8');
mkdir("test/".$new,0777);



回答2:


Try this

$new    =   "测试";
mkdir("test/".$new,0777);



回答3:


Try this

$new    =   urlencode ("测试");
mkdir("test/".$new,0777);

and use urldecode if you want original name;



来源:https://stackoverflow.com/questions/38789788/trouble-in-mkdir-with-chinese-characters-on-window-xampp

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!