Get json element with PHP

2

I made a print_r () of a result in json which gave the following:

stdClass Object
(
    [status] => 1
    [resultado] => stdClass Object
        (
            [BUSCA_BIN] => stdClass Object
                (
                    [BUSCA_BIN] => Array
                        (
                            [0] => stdClass Object
                                (
                                    [ITEM_ID] => MVT1687

[...]

I would like to get the ITEM_ID element, but this is always returning NULL.

How I'm trying:

var_dump($json->resultado->BUSCA_BIN->BUSCA_BIN->ITEM_ID);

//RESULTA UM NULL.

What do I do?

    
asked by anonymous 06.10.2017 / 01:15

1 answer

2

The last BUSCA_BIN is an array , example:

var_dump($json->resultado->BUSCA_BIN->BUSCA_BIN[0]->ITEM_ID);

PHP - array

    
06.10.2017 / 01:19