如何使用PHP重新设置关联数组的键?

时间:2018-08-09 06:06:48

标签: 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

0 个答案:

没有答案