I have this array called $locations and this is what it produces if I use print_r:
Array
(
[0] => stdClass Object
(
[term_id] => 40
[name] => California
[slug] => california
[term_group] => 0
[term_taxonomy_id] => 41
[taxonomy] => location
[description] =>
[parent] => 0
[count] => 6
)
)
What I need to get from this array is California only, but I can't figure out what variable produces that. I tried $locations->name and $locations[name] but none of those work.
$locations[0]) and then perform the object manipulation. If you don't intend to have multiple objects in one variable, then really you should be making$locationsjust the object, not an array of objects.