public static function insertElement(array $array, $element, $position) {
		$res = array_slice($array, 0, $position, true);
		
		if(is_array($element)) {
			$res = array_merge($res, $element);
		} else {
			array_push($res, $element);
		}
		
		$res = array_merge($res, array_slice($array, $position, count($array) - 1, true));
		
		return $res;
	}
public static function insertElement(array $array, $element, $position) {
		$res = array_slice($array, 0, $position, true);
		
		if(is_array($element)) {
			$res = array_merge($res, $element);
		} else {
			array_push($res, $element);
		}
		
		$res = array_merge($res, array_slice($array, $position, count($array) - 1, true));
		
		return $res;
	}
public static function insertElement ( array $ array , $ element , $ position ) { $ res = array_slice ( $ array , 0 , $ position , true ) ; if ( is_array ( $ element ) ) { $ res = array_merge ( $ res , $ element ) ; } else { array_push ( $ res , $ element ) ; } $ res = array_merge ( $ res , array_slice ( $ array , $ position , count ( $ array ) - 1 , true ) ) ; return $ res ; }
Adds a given element into the array on the given position without replacing the old entry

@param array $array
The array the element should be insert into
@param mixed $element
The element to insert
@param integer $position
The position to insert the element into the array.
If this value is greater than the array size, the element will be put at the end of the array
@return array
Adds a given element into the array on the given position without replacing the old entry