In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-03-01 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/03 Report--
Today, I will talk to you about how to create file name garbled php, many people may not know, in order to let you know more, Xiaobian summarized the following content for you, I hope you can harvest according to this article.
php create file name garbled solution: 1, create a PHP sample file;2, through the "rename ('a.zip', iconv ('UTF-8','GB2312//IGNORE', 'Chinese a.zip');" method modified to Chinese file name.
Operating environment: Windows 7 system, PHP7.1, Dell G3 computer.
What about php creating file names?
php generated Chinese file name will become garbled, should be resolved like this
PHP now has a lot of libraries, will generate files, such as generating zip files, generating two-dimensional codes and so on. These libraries are great to use, but once you generate a filename with Chinese, you're likely to get garbled.
Question:
The generated Chinese file name will become garbled
Solution:
Use functions: iconv(), rename()
When generating file names, directly generate English names, such as:a.zip, c.zip, etc. Then, use php's function rename to move files,
rename('a.zip',iconv('UTF-8', 'GB2312//IGNORE', ' Chinese a.zip'));
Ignore means to ignore errors in conversion. Without the ignore parameter, all strings following this character cannot be saved.
After reading the above, do you have any further understanding of how php creates file name garbled? If you still want to know more knowledge or related content, please pay attention to the industry information channel, thank you for your support.
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.