php - 如何使用 PHP 重新设置关联数组的键?
问题描述
假设我有以下来自此变量的数组:
echo '<pre>';
print_r(json_decode($mul_from));
echo '</pre>'
stdClass Object
(
[0] => Array
(
[0] => from 1
[1] => from 1
[2] => from 1
[3] => from 1
[4] => from 1
)
[1] => Array
(
[0] => from 2
[1] => from 2
[2] => from 2
[3] => from 2
[4] => from 2
)
[3] => Array
(
[0] => 5
[1] => from 3
[2] => from 3
[3] => from 3
)
)
如何将密钥重新设置为 0 1 2 3 等等?目前,它显示 0 1 3
解决方案
推荐阅读
- r - 如何在 Y 列上连接两个 data.tables,同时在其他列 X 上进行调节
- c# - 如果您最终将其转换为 IEnumerable,AsReadOnly 是否有意义?
- .htaccess - 将html重写到/页面,一页在另一页上,例如example/abc/xyz/
- python - 如何计算分钟数据集的 15 分钟标准差?
- html - HTML 标记提前关闭
- java - 如何从两个 ArrayList 中创建一个 HashMap?
- javascript - 在状态值之间切换 - 切换功能
- azure - App Insights:遥测未显示使用情况用户数据
- django - 如何在 django 用户中进行正确的密码加密?
- java - 将值从一个对象继承到另一个对象