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

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

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
Release: 2016-06-23 13:43:37
Original
1645 people have browsed it

PHP json_encode 二维数组

eg:

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



json_encode后

期望:数组类型

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

实际:对象类型

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


Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template