1

我有这个输出:,我想去“中心”。

[field_affiliation] => Array(
   [und] => Array(
      [0] => Array(
         [tid] => 30
         [taxonomy_term] => stdClass Object(
            [tid] => 30
            [vid] => 2
            [name] => Center

我可以使用这种方法吗?
$affiliation=$node->field_affiliation['und']['0']['value']['taxonomy_term']['name'];

或者我该如何使用: drupal_array_get_nested_value();- 我无法理解文档

4

1 回答 1

0

试试这个它会起作用,因为名称在对象'taxonomy_term'下

$affiliation=$node->field_affiliation['und']['0']['taxonomy_term']->name;

于 2011-09-14T06:20:38.693 回答