-
-
Save llbbl/7457776 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
function array_splice_preserve ($input, $offset, $length, $replacement) { | |
$keys = array_keys($input); | |
$values = array_values($input); | |
array_splice($keys, $offset, $length, array_keys($replacement)); | |
array_splice($values, $offset, $length, array_values($replacement)); | |
return array_combine($keys, $values); | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment