Insert element into an array at a specific position.

Paramètres

array $input_array: The original array.

array $new_value: The element that is getting inserted.

int $location_key: The key location.

Return value

array The new array with the element merged in.

1 call to advagg_insert_into_array_at_location()
advagg_mod_element_info_alter dans advagg_mod/advagg_mod.module
Implements hook_element_info_alter().

Fichier

./advagg.module, line 6127

Code

function advagg_insert_into_array_at_location(array $input_array, array $new_value, $location_key) {
    return array_merge(array_slice($input_array, 0, $location_key), $new_value, array_slice($input_array, $location_key));
}