Created
January 26, 2021 13:03
-
-
Save slav123/71897eda22825564aff7847581fac566 to your computer and use it in GitHub Desktop.
array_insert
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_insert (&$array, $position, $insert_array) { | |
$first_array = array_splice ($array, 0, $position); | |
$array = array_merge ($first_array, $insert_array, $array); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment