[ create a new paste ] login | about

Link: http://codepad.org/pIjA95rG    [ raw code | output | fork ]

PHP, pasted on Aug 21:
<?php

$testArray = array();

$nestedA = array();
$nestedB = array();

$nestedA["test"] = "hello worlda!";
$nestedA["testb"] = "hello worldb!";
$nestedB["test"] = "hello worldc!";
$nestedB["testb"] = "hello worldd!";

$testArray["23"] = $nestedA;
$testArray["26"] = $nestedB;

$finalArray = array_values($testArray);

print_r($testArray);
print_r($finalArray);



?>


Output:
Array
(
    [23] => Array
        (
            [test] => hello worlda!
            [testb] => hello worldb!
        )

    [26] => Array
        (
            [test] => hello worldc!
            [testb] => hello worldd!
        )

)
Array
(
    [0] => Array
        (
            [test] => hello worlda!
            [testb] => hello worldb!
        )

    [1] => Array
        (
            [test] => hello worldc!
            [testb] => hello worldd!
        )

)


Create a new paste based on this one


Comments: