当前位置:网站首页>Two dimensional format array format index subscript continuity problem leads to return JSON format problem
Two dimensional format array format index subscript continuity problem leads to return JSON format problem
2022-07-03 02:34:00 【qq_ twenty-seven million eight hundred and seventy-eight thousa】
1. Array subscripts are continuous return json Format without index
[
0=>[
'id'=>1,
'title'=>' Test one ',
],
1=>[
'id'=>1,
'title'=>' Test one ',
],
2=>[
'id'=>1,
'title'=>' Test one ',
],
]
{
"msg": "ok",
"data": [
{
"id": 1,
"title": " Test one "
},
{
"id": 1,
"title": " Test one "
},
{
"id": 1,
"title": " Test one "
}
]
}
2. Array subscripts are discontinuous , return json Format with index
[
0=>[
'id'=>1,
'title'=>' Test one ',
],
2=>[
'id'=>1,
'title'=>' Test one ',
],
5=>[
'id'=>1,
'title'=>' Test one ',
],
];
{
"msg": "ok",
"data": {
"0": {
"id": 1,
"title": " Test one "
},
"2": {
"id": 1,
"title": " Test one "
},
"5": {
"id": 1,
"title": " Test one "
}
}
}
3. terms of settlement Reset index continuation
// Reset continuous index
$lst = array_slice($lst, 0, count($lst), false);
return $lst;
边栏推荐
- Gbase 8C system table PG_ am
- 面试八股文整理版
- GBase 8c触发器(二)
- GBase 8c 创建用户/角色 示例二
- Gbase 8C system table PG_ attribute
- oauth2.0鉴权,登录访问 “/oauth/token”,请求头Authorization(basicToken)如何取值???
- Codeforces Round #418 (Div. 2) D. An overnight dance in discotheque
- SPI机制
- 2022-2028 global splicing display industry research and trend analysis report
- leetcode540
猜你喜欢

oauth2.0鉴权,登录访问 “/oauth/token”,请求头Authorization(basicToken)如何取值???

定了,就选它

Build a private cloud disk cloudrev
![[shutter] banner carousel component (shutter_wiper plug-in | swiper component)](/img/a6/5c97ef3f34702b83ebf0511501d757.gif)
[shutter] banner carousel component (shutter_wiper plug-in | swiper component)

Memory pool (understand the process of new developing space from the perspective of kernel)
【ROS进阶篇】第六讲 ROS中的录制与回放(rosbag)

线程安全的单例模式
![[shutter] bottom navigation bar page frame (bottomnavigationbar bottom navigation bar | pageview sliding page | bottom navigation and sliding page associated operation)](/img/6e/67bc187a89fb9125856c78c89f7bfb.gif)
[shutter] bottom navigation bar page frame (bottomnavigationbar bottom navigation bar | pageview sliding page | bottom navigation and sliding page associated operation)

8 free, HD, copyright free video material download websites are recommended

Restcloud ETL cross database data aggregation operation
随机推荐
GBase 8c系统表-pg_amop
COM and cn
Choose it when you decide
【Flutter】shared_ Preferences local storage (introduction | install the shared_preferences plug-in | use the shared_preferences process)
Error invalid bound statement (not found): com ruoyi. stock. mapper. StockDetailMapper. XXXX solution
Apple releases MacOS 11.6.4 update: mainly security fixes
SPI mechanism
awk从入门到入土(0)awk概述
GBase 8c系统表-pg_class
What does "where 1=1" mean
【ROS进阶篇】第六讲 ROS中的录制与回放(rosbag)
通达OA v12流程中心
Oauth2.0 authentication, login and access "/oauth/token", how to get the value of request header authorization (basictoken)???
5.文件操作
Principle and application of database
简单理解svg
[fluent] listview list (map method description of list set | vertical list | horizontal list | code example)
UDP receive queue and multiple initialization test
Monitoring and management of JVM
Word word word