0
$content
はarryです。 i print_r($content)
の場合、結果が長すぎます。今私phpでforechするのは非常に難しい結果です。
echo $fenlei=$content['body']['#object']->field_fenlei['zh-hans'][0]['taxonomy_term']->name;
$fenlei
の結果はjava
です。多分$ fenleiの値が多分あるでしょう。例えば:
$content['body']['#object']->field_fenlei['zh-hans'][0]['taxonomy_term']->name;
$content['body']['#object']->field_fenlei['zh-hans'][1]['taxonomy_term']->name;
$content['body']['#object']->field_fenlei['zh-hans'][2]['taxonomy_term']->name;
......
方法
$content['body']['#object']->field_fenlei['zh-hans'][1]['taxonomy_term']->name;
$content['body']['#object']->field_fenlei['zh-hans'][2]['taxonomy_term']->name;
値外ループへ。それは私のためにあまりにも難しいです。 :)
'print_r'を使って最初に配列から取得している出力の配列階層を提供してください –