I have an array like this:
Array
(
[count] => 2
[0] => stdClass Object
(
[term_id] => 3109
[name] => Aliens: Colonial Marines
[slug] => aliens-colonial-marines
)
[1] => stdClass Object
(
[term_id] => 228
[name] => Dragon Quest X: Rise of the Five Tribes
[slug] => dragon-quest-x-rise-of-the-five-tribes
)
)
I need to run a cycle that grab the “slug” value from each element.
How I can accomplish this result?
It simply loops through the array
$arrayand if the element is an object (so it doesn’t try to parsecount), it echoesslug.