problem with printing multiple cck value inside node-type.tpl.php I am printing out this thing inside node-mytype.tpl.php (D6):

$dots = '';
$i = 0;
foreach($node-&gt;field_authors as $item) {
    $i = $i + 1;
    if ($i &lt; count($node-&gt;field_authors)) { $dots = ',  '; } else { $dots = '.  '; };
    print '&lt;span&gt;'. $item['view'].$dots.'&lt;/span&gt;';
}


Can somebody explain to me, why in this case printing $item['view'] == succesfully printing cck field values? Shouldn't it be like $item[i]['view']?

When i'm printing cck multiple values im usually do it this way:

print $node-&gt;field_authors[0]['view'];
print $node-&gt;field_authors[1]['view']; // if 2 values


Explain to me please, i would really appreciate it...
Your code uses foreach which takes $node-&gt;field_authors[0,1,etc] and relays that value through $item.  If you want to know the key for the current field inside your foreach loop, rewrite the code like this:

$dots = '';
$i = 0;
foreach($node-&gt;field_authors as $key =&gt; $item) {
    $i++;
    if ($i &lt; count($node-&gt;field_authors)) { $dots = ',  '; } else { $dots = '.  '; };
    print '&lt;span&gt;'. $node-&gt;field_authors[$key]['view'].$dots.'&lt;/span&gt;';
    // note: $node-&gt;field_authors[$key] is the same as $item['view']
}