当前位置:网站首页>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;
边栏推荐
- Kotlin middle process understanding and Practice (I)
- RestCloud ETL 跨库数据聚合运算
- [translation] modern application load balancing with centralized control plane
- GBase 8c系统表-pg_attribute
- 2022-2028 global splicing display industry research and trend analysis report
- random shuffle注意
- "Analysis of 43 cases of MATLAB neural network": Chapter 43 efficient programming skills of neural network -- Discussion Based on the characteristics of the new version of MATLAB r2012b
- Job object of collaboration in kotlin
- My creation anniversary
- oauth2.0鉴权,登录访问 “/oauth/token”,请求头Authorization(basicToken)如何取值???
猜你喜欢
[shutter] setup of shutter development environment (supplement the latest information | the latest installation tutorial on August 25, 2021)
HW-初始准备
easyPOI
xiaodi-笔记
Summary of interview project technology stack
Oauth2.0 authentication, login and access "/oauth/token", how to get the value of request header authorization (basictoken)???
Classes and objects - initialization and cleanup of objects - constructor call rules
Build a private cloud disk cloudrev
Detailed introduction to the deployment and usage of the Nacos registry
easyExcel
随机推荐
My creation anniversary
Gbase 8C system table PG_ amop
Unrecognized SSL message, plaintext connection?
random shuffle注意
Cancellation of collaboration in kotlin, side effects of cancellation and overtime tasks
awk从入门到入土(1)awk初次会面
Detailed analysis of micro service component sentinel (hystrix)
【翻译】具有集中控制平面的现代应用负载平衡
面试项目技术栈总结
《MATLAB 神经网络43个案例分析》:第43章 神经网络高效编程技巧——基于MATLAB R2012b新版本特性的探讨
Unrecognized SSL message, plaintext connection?
[fluent] listview list (map method description of list set | vertical list | horizontal list | code example)
Apple releases MacOS 11.6.4 update: mainly security fixes
The data in servlet is transferred to JSP page, and the problem cannot be displayed using El expression ${}
Tongda OA homepage portal workbench
MATLAB小技巧(24)RBF,GRNN,PNN-神经网络
Gbase 8C trigger (I)
【 tutoriel】 Chrome ferme les cors et les messages de la politique inter - domaines et apporte des cookies à travers les domaines
[translation] flux is safe. Gain more confidence through fuzzy processing
require.context