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

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

WBOY
Release: 2016-06-23 13:19:40
Original
4253 people have browsed it

如何在键值对数组的后面追加多一对键值对
比如 
$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'] = $数组;

source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template