我爱占星网 我爱占星网
首页
编程
java
php
前端
首页 编程 java php 前端

如何制作阵列? [关闭]

i have a problem. I have two arrays and i need to put one into other like this:

array('1'=>1,'2'=>2,'3'=>array());

Can somebody advise how to solve it?

If your first array is

$first =  array('1'=>1,'2'=>2)

And the second is

$second =  array()

Then just add it in as

$first[] = $second

If the second is

$second[3] = array();

Then you want array_merge

$first = array_merge($first,$second)

There are all sorts of array functions on the left in that link, which come in very handy.

近期文章

  • 从数据库向URL添加值[关闭]
  • 为什么包含文件中的$ string没有出现在应该存在的位置?
  • 我想比较一个数组中的值与另一个数组的值
  • PHP LDAP绑定间歇性问题
  • 为什么shell_exec不执行文件但执行简单命令?
  • 我该如何重写这个htaccess文件?
  • 使用PHP将xdf文件附加到pdf
  • 我的PHP代码中有一个mysql查询,它被剪切并粘贴在两个地方。 我怎样才能让它在一个地方?
  • 使用strtotime()和date()更改日期时间格式时,空值导致特定日期时间
  • mysql事务不能与innodb表一起使用
  • php服务器端应用程序误解
  • 得到2进入响应 - jquery ajax调用
  • 合并DOM查询和file_get_contents
  • 上传XML文件并传入存储在cookie中的数组
  • 在Zf2中使用Codeigniter
  • 创建一个计数器php
  • NGINX(ubuntu)非常好的PHP网址
  • Mysql相对日期减法
  • 操纵PHP domdocument字符串
  • PHP在foreach循环中查找密码

Copyright ©2022 我爱占星 All Rights Reserved.

浙ICP备2022030071号-1

部分图文来自网络,如有侵犯您的版权,请告诉我们删除

友情链接:代码精华