显示返回对象的值

pra*_*tri 0 php arrays object

我有一个变量对象存储下面的值.

Array
(
    [0] => stdClass Object
        (
            [term_id] => 1
            [name] => Uncategorized
            [slug] => uncategorized
            [term_group] => 0
            [term_taxonomy_id] => 1
            [taxonomy] => category
            [description] => 
            [parent] => 0
            [count] => 4
            [object_id] => 39
            [cat_ID] => 1
            [category_count] => 4
            [category_description] => 
            [cat_name] => Uncategorized
            [category_nicename] => uncategorized
            [category_parent] => 0
        )

)
Run Code Online (Sandbox Code Playgroud)

我现在想要显示slug值列表.我怎么做的?

Joh*_*nde 5

假设该对象存储在一个名为$array:

echo $array[0]->slug
Run Code Online (Sandbox Code Playgroud)