Php array key names can be Chinese, which experts have used it, will it be a problem?-php Tutorial

Source: Internet
Author: User
Php array key names can be in Chinese, who has used them, will there be any problem... RT & nbsp; will the Chinese key name be left behind? & gt; ------ solution ------------------ available, no problem ------ solution ------------------ the php array key name will be converted into a hash & nbsp; php array key name can be Chinese, who has used it, will there be any problem...
Will the RT Chinese key name be left behind?>


------ Solution --------------------
Yes
------ Solution --------------------
The php array key name is converted into a hash key by php. Theoretically, there is no problem. However, Chinese characters always cause many strange bugs. For example, the low-byte 5c problem in gbk.

In other character sets, unicode recognized by php is inconsistent. I guess, but I have never practiced:

If your a. php code uses gbk encoding, the code declares an array of Chinese keys for $ a ['China'] = '20160301.
B. php references a. php. However, the B. php file is UTF-8 encoded. Then echo $ a ['Chinese'] in B. php.
In this case, the hash keys converted by the 'Chinese' in the two files in php may be inconsistent, which may result in B. $ a ['China'] in php does not have any value.

Therefore, it is best not to use Chinese characters.
------ Solution --------------------
Haha, there is a code scrambling tool that uses this to prevent you from cracking.
------ Solution --------------------
Try these words (limited to GBK): something else

If there are no problems with these words, it's all done ......

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.