Home >Backend Development >PHP Tutorial >PHP 小坑 mark(PHP json_encode 二维数组)

PHP 小坑 mark(PHP json_encode 二维数组)

WBOY
WBOYOriginal
2016-06-23 13:43:371596browse

PHP json_encode 二维数组

eg:

array(  3 => array(    'a' => 1,    'b' => 2,        ),);



json_encode后

期望:数组类型

[{"a":"1","b":"2"}]

实际:对象类型

{"3": .....省略}


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