首页 > 解决方案 > How to add in digits per json objects wih php

问题描述

img

How do I add digits per objects?

https://paste.ubuntu.com/p/mSzJnY87KF/

I want to do;

img

what I have to do, I have tried many ways.

tnks for responses

标签: php

解决方案


只需要这样的东西

$arr = [];
$arr["1"] = "content 1";
$arr["10"] = "content 2";
echo json_encode($arr);

不使用array_push


推荐阅读