Do a render foreach loop on a regular field? I have a regular field with multiple values,
If i do 

render( $fields['field1'] )


It prints

Field1_value1
Field1_value2
Field1_value3
etc


Am trying to get it to output like this

[Field1_value1]
[Field1_value2]
[Field1_value3]
etc


To add [ and ] to the output.
I thought of using a foreach loop, but the field array is like such

'#title' =&gt; 'xxxx',
'#type' =&gt; 'xxxx',
...
'0' =&gt; &lt;array&gt;,
'1' =&gt; &lt;array&gt;,
'2' =&gt; &lt;array&gt;,


How can I get it to loop throught the [0], [1], [2] etc only?

Note: I have no control on how many multiple values the field may have, so I have to loop.



Another solution that worked well for me: Display comma-separated list of taxonomy terms?

You can make use of the power of field.tpl.php.
$field_values = element_children($fields['field1']);
foreach($field_values as $field_value) { ... }


I was looking for the answer to this too, and ended up hunting through the render() function. It wasn't too far down the chain: drupal_render() calls element_children().


  element_children
  
  Identifies the children of an element array, optionally sorted by weight.
  
  The children of a element array are those key/value pairs whose key does not start with a '#'. See drupal_render() for details.