src/Arrays/ArrayUtil.php
public function insertInArrayByName(array &$current, string $key, $value, int $offset = 0, bool $strict = false)
    {
        if (false !== ($intIndex = array_search($key, array_keys($current), $strict))) {
            array_insert($current, $intIndex + $offset, $value);
        }
    }
public function insertInArrayByName(array &$current, string $key, $value, int $offset = 0, bool $strict = false)
    {
        if (false !== ($intIndex = array_search($key, array_keys($current), $strict))) {
            array_insert($current, $intIndex + $offset, $value);
        }
    }
public function insertInArrayByName ( array & $ current , string $ key , $ value , int $ offset = 0 , bool $ strict = false ) { if ( false !== ( $ intIndex = array_search ( $ key , array_keys ( $ current ) , $ strict ) ) ) { array_insert ( $ current , $ intIndex + $ offset , $ value ) ; } }
Insert a value into an existing array by key name.

@param array  $current The target array
@param string $key     the existing target key in the array
@param mixed  $value   the new value to be inserted
@param int    $offset  offset for inserting the new value
@param bool   $strict  use strict behavior for array search
Insert a value into an existing array by key name .