当前位置:网站首页>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;
边栏推荐
猜你喜欢

where 1=1 是什么意思

错误Invalid bound statement (not found): com.ruoyi.stock.mapper.StockDetailMapper.xxxx解决
![[hcia]no.15 communication between VLANs](/img/59/a467c5920cbccb72040f39f719d701.jpg)
[hcia]no.15 communication between VLANs
![Error when installing MySQL in Linux: starting mysql The server quit without updating PID file ([FAILED]al/mysql/data/l.pid](/img/32/25771baad1ed06c5a592087df748f1.jpg)
Error when installing MySQL in Linux: starting mysql The server quit without updating PID file ([FAILED]al/mysql/data/l.pid

The use of Flink CDC mongodb and the implementation of Flink SQL parsing complex nested JSON data in monggo

Build a private cloud disk cloudrev

Tongda OA V12 process center

Detailed introduction to the deployment and usage of the Nacos registry

Pytorch convolution network regularization dropblock

oauth2.0鉴权,登录访问 “/oauth/token”,请求头Authorization(basicToken)如何取值???
随机推荐
My creation anniversary
2022-2028 global splicing display industry research and trend analysis report
人脸识别6- face_recognition_py-基于OpenCV使用Haar级联与dlib库进行人脸检测及实时跟踪
Unrecognized SSL message, plaintext connection?
为什么会选择框架?选择什么样的框架
Restcloud ETL cross database data aggregation operation
Detailed introduction to the deployment and usage of the Nacos registry
GBase 8c系统表-pg_aggregate
Apple releases MacOS 11.6.4 update: mainly security fixes
COM and cn
基于can总线的A2L文件解析(2)
Gbase 8C trigger (III)
Packing and unpacking of JS
GBase 8c系统表-pg_collation
MUX VLAN Foundation
Memory pool (understand the process of new developing space from the perspective of kernel)
SPI机制
Coroutinecontext in kotlin
Informatics Olympiad one general question bank 1006 a+b questions
awk从入门到入土(3)awk内置函数printf和print实现格式化打印