Skip to content

Instantly share code, notes, and snippets.

@luxixing
Created August 15, 2013 03:17
Show Gist options
  • Save luxixing/6237917 to your computer and use it in GitHub Desktop.
Save luxixing/6237917 to your computer and use it in GitHub Desktop.
常见问题汇总
1 php json_encode
假设encode编码的源数据是 : array(1,2,3,4,5,5),那么json_encode的结果是数组
假设encode编码的源数据是:array(1=>1,2=>3),那么json_encode的结果是对象
json_encode默认把关联数组编码为对象
这个细节在和前端js交互传递数据的时候非常重要
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment