The glob function is okay in the local window. problems occurred when uploading to linux.

Source: Internet
Author: User
Tags glob
Urgent! The glob function is fine in the local window. if a problem occurs during the upload to linux, my program uses UTF-8 encoding, allowing users to register a Chinese user name and generate a file named in this Chinese language, such: member/162100. phpmember/Juan? Too many Encoding. php // UTF-8 encoded file urgent! The glob function is okay in the local window. a problem occurs when uploading data to linux.
For example, my program uses UTF-8 encoding, allowing users to register a Chinese user name and generate a file named in this Chinese language, such:
Member/162100.php
Member/Juan? Encoding encoding. php // UTF-8 encoded file. the actual Chinese name is "none. php".

The problem is that when you use $ arr = glob ('Member/*. php') to edit a member,

Windows local test is okay, upload to space linux only returns member/162100.php, why. Please advise.

------ Solution --------------------
It is estimated that it has nothing to do with the system. it is a problem with your php configuration. use phpinfo to check it.
------ Solution --------------------
Use the dir object to see what is returned ..

$ D = dir ("/etc/php5 ");
Echo "Handle:". $ d-> handle. "\ n ";
Echo "Path:". $ d-> path. "\ n ";
While (false! ==( $ Entry = $ d-> read ())){
Echo $ entry. "\ n ";
}
$ D-> close ();
?>
------ Solution --------------------
Create a relational table. I have abandoned using a Chinese file name outside windows :)

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.