Home  >  Article  >  Backend Development  >  array加入新阵列如何宣告?

array加入新阵列如何宣告?

WBOY
WBOYOriginal
2016-06-23 13:39:53707browse

$data=Array ('id' => 123,'name' => name);

用array_push会出错,请问要怎么宣告?


回复讨论(解决方案)

你臆造出的新名词,有谁能懂?

目前要加新的阵列值上去
原本:

Array ('id' => 123,'name' => name);

加上:
Array ('type' => 1);

变成:
Array ('id' => 123,'name' => name,'type' => 1);

请问要怎么改?

$a = Array ('id' => 123,'name' => 'name');$a['type'] = 1;

$data['type'] = 1;

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