Home >Backend Development >PHP Tutorial >PHP 如何在键值对数组的后面追加多一对键值对

PHP 如何在键值对数组的后面追加多一对键值对

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOriginal
2016-06-23 13:19:404297browse

如何在键值对数组的后面追加多一对键值对
比如 
$arr1= array (
"a" => '1',
"b" => '2',
"c" => '3',
"d" => '4');
将他变成
$arr2=array (
"a" => '1',
"b" => '2',
"c" => '3',
"d" => '4',
                        "f" => '5',);
要怎么样做。才能在键值对数组里面添加新的键值对.


回复讨论(解决方案)

直接赋值不可以么!!!这么easy

直接  $array['f'] = $数组;

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn