tags:

views:

14

answers:

2

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  A: 

Try this:

$array = ...
foreach($array as $obj) {
   //do something with $obj->id...
}
Jacob Relkin
+2  A: 
foreach ($node->field_multip as $key => $value) {
    // code
}
Kevin
This did the job, but looks like I still need a way to get the length of the multi-value field for other reasons. I've started another question here if anyone can help with that specific question: `http://stackoverflow.com/questions/3390947/finding-length-of-multi-value-field` Looks like drupal may be different.
loop