function drupal_array_merge_deep

cis7 drupal_array_merge_deep()
cle7 drupal_array_merge_deep()
elmsmedia7 drupal_array_merge_deep()
icor7 drupal_array_merge_deep()
meedjum_blog7 drupal_array_merge_deep()
mooc7 drupal_array_merge_deep()

Merges multiple arrays, recursively, and returns the merged array.

This function is similar to PHP's array_merge_recursive() function, but it handles non-array values differently. When merging values that are not both arrays, the latter value replaces the former rather than merging with it.


$link_options_1 = array('fragment' => 'x', 'attributes' => array('title' => t('X'), 'class' => array('a', 'b')));
$link_options_2 = array('fragment' => 'y', 'attributes' => array('title' => t('Y'), 'class' => array('c', 'd')));

// This results in array('fragment' => array('x', 'y'), 'attributes' => array('title' => array(t('X'), t('Y')), 'class' => array('a', 'b', 'c', 'd'))).
$incorrect = array_merge_recursive($link_options_1, $link_options_2);

// This results in array('fragment' => 'y', 'attributes' => array('title' => t('Y'), 'class' => array('a', 'b', 'c', 'd'))).
$correct = drupal_array_merge_deep($link_options_1, $link_options_2);


...: Arrays to merge.

Return value

The merged array.

See also


7 calls to drupal_array_merge_deep()
DrupalWebTestCase::drupalPostAJAX in modules/simpletest/drupal_web_test_case.php
Execute an Ajax submission.
EntityReferencePrepopulateInstanceBehavior::settingsForm in sites/all/modules/ulmus/entityreference_prepopulate/plugins/behavior/EntityReferencePrepopulateInstanceBehavior.class.php
Generate a settings form for this handler.
field_views_data in sites/all/modules/ulmus/views/modules/
Implements hook_views_data().
og_get_mocked_instance in sites/all/modules/ulmus/og/includes/
Helper function; Get the mocked instance.
views_handler_field_file_link_download::render_link in sites/all/modules/ulmus/file_entity/views/
Renders the link.

... See full list


includes/, line 2100
Functions that need to be loaded on every Drupal request.


function drupal_array_merge_deep() {
  $args = func_get_args();
  return drupal_array_merge_deep_array($args);



Error message

  • Warning: Cannot modify header information - headers already sent by (output started at /var/www/html/elmsln_community/ in drupal_send_headers() (line 1499 of /var/www/html/elmsln_community/
  • Error: Call to undefined function apc_delete() in DrupalAPCCache->clear() (line 289 of /var/www/html/elmsln_community/
The website encountered an unexpected error. Please try again later.