element_children

5 common.inc element_children($element)
6 common.inc element_children($element)
7 common.inc element_children(&$elements, $sort = FALSE)
8 common.inc element_children(&$elements, $sort = FALSE)

Get keys of a structured array tree element that are not properties (i.e., do not begin with '#').

37 calls to element_children()

File

includes/common.inc, line 3084
Common functions that many Drupal modules will need to reference.

Code

function element_children($element) {
  return array_filter(array_keys((array) $element), 'element_child');
}

Comments

The idea in using

The idea in using element_children() is that I would haven't to go hunting down dead-end branches, thereby increasing performance?

Actually, this function comes

This function comes in handy especially when looping through elements in forms. For example, a fieldset array will include array elements on the same level as string variables like #type, etc. that you don't want to affect.

Login or register to post comments