I don't want to combine two obyes and have keys

41 Views Asked by At

I combined 2 objects as below, but I don't want the keys to be in the output I get.

$link1 = '{"Success":true,"Result":[{"eventId":650810,"sportId":"2"}]}';
$link2 = '{"Success":true,"Result":[{"eventId":650811,"sportId":"2"}]}';

$a []= json_decode($link1, true);
$a []= json_decode($link2, true);

echo "<pre>";
print_r($a);

the output i get in this way is as follows, without using foreach [0] => Array,[1] => Array I don't want these to happen

Array
(
[0] => Array
    (
        [Success] => 1
        [Result] => Array
            (
                [0] => Array
                    (
                        [eventId] => 650810
                        [sportId] => 2
                    )

            )

    )

 [1] => Array
    (
        [Success] => 1
        [Result] => Array
            (
                [0] => Array
                    (
                        [eventId] => 650811
                        [sportId] => 2
                    )

            )

    )

)

Since I will search with the function, I need to remove the keys and I need to get the output as below.

Array
(
 Array
(
    [Success] => 1
    [Result] => Array
        (
            [0] => Array
                (
                    [eventId] => 650810
                    [sportId] => 2
                )

        )

)

  Array
 (
    [Success] => 1
    [Result] => Array
        (
            [0] => Array
                (
                    [eventId] => 650811
                    [sportId] => 2
                )

        )

)

)

many of my attempts have been consistently unsuccessful

0

There are 0 best solutions below