如何获取此类的缩略图

时间:2019-04-20 04:53:05

标签: php

如何从中获取缩略图

stdClass Object ( 
[data] => 
stdClass Object ( [id] => 11113 [type] => Item [attributes] => 
stdClass Object ( [product_name] => AEM Cam Gears [part_number] => aem23-830BK [mfr_part_number] => 23-830BK 
[part_description] => AEM 4G63/T Black Tru-Time Cam Gear [category] => Engine Components [subcategory] => Cam Gears [dimensions] => 
Array ( 
[0] => stdClass Object ( [box_number] => 1 [length] => 6.75 [width] => 6.75 [height] => 1.75 [weight] => 1.25 ) ) [brand_id] => 1 [brand] => AEM [price_group_id] => 101 [price_group] => AEM [active] => 1 
[regular_stock] => 1 [dropship_controller_id] => 1 [air_freight_prohibited] => [not_carb_approved] => 1 [ltl_freight_required] => [prop_65] => Unknown [epa] => Unknown [warehouse_availability] =>
 Array ( 
[0] => stdClass Object ( [location_id] => 01 [can_place_order] => 1 ) 
[1] => stdClass Object ( [location_id] => 02 [can_place_order] => 1 ) 
[2] => stdClass Object ( [location_id] => 59 [can_place_order] => 1 ) ) [thumbnail] => https://d5otzd52uv6zz.cloudfront.net/58a346f7-c183-4a72-9fea-c47c6e3d3e1f-100.jpg [barcode] => 840879020293 ) ) )

1 个答案:

答案 0 :(得分:1)

很明显,您只需要服用

$myObj->data->attributes->thumbnail

如果您已格式化“ vardump”,则会看到它:

stdClass Object (
    [data] => stdClass Object (
        [id] => 11113
        [type] => Item
        [attributes] => stdClass Object (
            [product_name] => AEM Cam Gears
            [part_number] => aem23-830BK
            [mfr_part_number] => 23-830BK
            [part_description] => AEM 4G63/T Black Tru-Time Cam Gear
            [category] => Engine Components
            [subcategory] => Cam Gears
            [dimensions] => Array (
                [0] => stdClass Object (
                    [box_number] => 1
                    [length] => 6.75
                    [width] => 6.75
                    [height] => 1.75
                    [weight] => 1.25
                )
            )
            [brand_id] => 1
            [brand] => AEM
            [price_group_id] => 101
            [price_group] => AEM
            [active] => 1
            [regular_stock] => 1
            [dropship_controller_id] => 1
            [air_freight_prohibited] =>
            [not_carb_approved] => 1
            [ltl_freight_required] =>
            [prop_65] => Unknown
            [epa] => Unknown
            [warehouse_availability] => Array (
                [0] => stdClass Object (
                    [location_id] => 01
                    [can_place_order] => 1
                )
                [1] => stdClass Object (
                    [location_id] => 02
                    [can_place_order] => 1
                )
                [2] => stdClass Object (
                    [location_id] => 59
                    [can_place_order] => 1
                )
            )
            [thumbnail] => https://d5otzd52uv6zz.cloudfront.net/58a346f7-c183-4a72-9fea-c47c6e3d3e1f-100.jpg [barcode] => 840879020293
        )
    )
)