问题
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