I need to loop through all the values of a multi field as per example bellow:
for ($i = 1; $i < ???; $i++) {
$a = $form['field_...']['und'][$i]['#entity']->field_...['und'][0]['value'];
}
of course I could do something like this
foreach ($form['field_additional_sections']['und'] as $key=>$value) {
if (is_int($key)) {
....
}
}
but I was wondering if there is a nicer option to do this. I should probably mention that I'm implementing hook_FORM_ID_form_alter.
Thank you