function drupal_array_merge_deep

cis7 bootstrap.inc drupal_array_merge_deep()
cle7 bootstrap.inc drupal_array_merge_deep()
elmsmedia7 bootstrap.inc drupal_array_merge_deep()
icor7 bootstrap.inc drupal_array_merge_deep()
meedjum_blog7 bootstrap.inc drupal_array_merge_deep()
mooc7 bootstrap.inc 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.

Example:

$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);

Parameters

...: Arrays to merge.

Return value

The merged array.

See also

drupal_array_merge_deep_array()

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/field.views.inc
Implements hook_views_data().
og_get_mocked_instance in sites/all/modules/ulmus/og/includes/og.field.inc
Helper function; Get the mocked instance.
views_handler_field_file_link_download::render_link in sites/all/modules/ulmus/file_entity/views/views_handler_field_file_link_download.inc
Renders the link.

... See full list

File

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

Code

function drupal_array_merge_deep() {
  $args = func_get_args();
  return drupal_array_merge_deep_array($args);
}
Error | ELMSLN API

Error

×

Error message

  • Warning: Cannot modify header information - headers already sent by (output started at /var/www/html/elmsln_community/api.elmsln.org/includes/common.inc:2791) in drupal_send_headers() (line 1499 of /var/www/html/elmsln_community/api.elmsln.org/includes/bootstrap.inc).
  • Error: Call to undefined function apc_delete() in DrupalAPCCache->clear() (line 289 of /var/www/html/elmsln_community/api.elmsln.org/sites/all/modules/apc/drupal_apc_cache.inc).
The website encountered an unexpected error. Please try again later.