How to get only one element from an associative array

0

I'm pulling from the Cosmos API the data of a product, it returns me a json that I converted to an array string using $array = json_decode($data);

When I run var_dump($array) it returns me this:

object(stdClass)#34 (15) {

["description"]=> string(58) "ABSORVENTE COM ABAS INTIMUS GEL C/32 TRI PROTECT SECA UNIT"

["gtin"]=> float(7896007544059)

["thumbnail"]=> string(57) "https://cdn-cosmos.bluesoft.com.br/products/7896007544059"

["price"]=> string(8) "R$ 11,99"

I would like to know how do I just get the ["thumbnail"] link?

    
asked by anonymous 08.06.2017 / 20:02

1 answer

0

Try this way: $ array-> thumbnail;

Since the true parameter in json_decode has not been passed, it is returning an object.

    
08.06.2017 / 20:28