duanbinian2243 2010-08-02 18:30
浏览 51
已采纳

drupal读取数组类型字段

I have a multi value cck field.

I can read any single id with node->field_multip[0][id].

How do I read all ids? I tried a for loop with field_multip.length but the page never finishes loading. What's the right way of doing this?

field_multip
   [0] 
      [id]
      [sec]
   [1]
      [id]
      [sec]
   [2]
      [id]
      [sec]
  • 写回答

2条回答 默认 最新

  • dsux90368 2010-08-02 18:37
    关注
    foreach ($node->field_multip as $key => $value) {
        // code
    }
    
    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(1条)

报告相同问题?