I'm trying to get the value out of an array in PHP.
The value of $v when displayed with print_r($v) is as follows:
Array ( [0] => Array ([name] => BLARGH )
[1] => Array ( [name] => TEMP CATEGORY )
)
I'm trying to iterate over this and pull out the value of the name key as follows:
foreach($v as $category) {
echo $category->name;
}
The echo returns no value. Further, if I add a print_r($category) to the loop I get a return of
Array ( [name] => TEMP CATEGORY )
How do I get the name value out of the array?