Home > Backend Development > PHP Tutorial > array加入新阵列怎么宣告

array加入新阵列怎么宣告

WBOY
Release: 2016-06-13 12:15:10
Original
1013 people have browsed it

array加入新阵列如何宣告?

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

用array_push会出错,请问要怎么宣告?
------解决思路----------------------
$a = Array ('id' => 123,'name' => 'name');<br />$a['type'] = 1;
Copy after login

------解决思路----------------------
$data['type'] = 1;

Related labels:
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