Скажем, у меня есть ассоциативный массив:
array(
"color" => "red",
"taste" => "sweet",
"season" => "summer"
);
и я хочу ввести в него новый элемент:
"texture" => "bumpy"
за вторым элементом, но сохраняя все ключи массива:
array(
"color" => "red",
"taste" => "sweet",
"texture" => "bumpy",
"season" => "summer"
);
есть ли функция для этого? array_splice()
не будет вырезать его, он может работать только с цифровыми клавишами.