Home >php教程 >php手册 >php数组里可能用中文来当键吗?如果可以有什么弊端?

php数组里可能用中文来当键吗?如果可以有什么弊端?

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOriginal
2016-06-06 20:08:292736browse

php中数组里面能用中文来当键吗? 回答当然是可以. 既然可以用,又会有什么不好之处了? 弊端就是如果页面编码不统一,可能会有异常. 但个人认为数组键还是不要用中文,用字符或数字会更好.

php中数组里面能用中文来当键吗?

回答当然是可以.

既然可以用,又会有什么不好之处了?

弊端就是如果页面编码不统一,可能会有异常.

但个人认为数组键还是不要用中文,用字符或数字会更好.

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn