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

重新排序数组以删除上级0索引

I'm wanting to know how I can reindex my array that has a upper level index [0]

My array looks like this

$test = array(
   [0] => array(
      id = 1
   )
)

What I want is

$test = array(
      id = 1
)

I know that I can do a foreach to get what I want, but wondering is there a function that does the samething.

This should do it with the example you gave:

$test = $test[0];

If your problem is more complex, tell us more.

近期文章

  • Php sql DISTINCT行id没有重复
  • 多个Ajax调用有时会失败
  • php if else多行速记
  • 回显从控制器发送的数据
  • 在Codeigniter中获取数组到控制器的值
  • 表单没有提交,页面正在重新加载php
  • 如何在警报脚本中插入GEOIP标注?
  • 用于报告提取的php中的500内部服务器错误
  • 当用户在PHP中提交空或错表单时,自动对焦到输入字段?
  • 即使我尝试编码JSON_HEX_QUOT |,Json_Encode也不返回html JSON_HEX_TAG
  • 用于演示您网站的软件[关闭]
  • 使用php codeigniter上传图片的问题
  • 简单的联系表单不发送邮件与PHP mail()函数[重复]
  • 如何在php for循环中生成动态字体真棒图标
  • 在控制器CakePHP中使用同一函数中的两个数据库
  • Google App Engine dispatch.yaml验证错误PHP模块
  • 在非对象上调用成员函数prepare()(致命错误)
  • 安全注册,使用hash()登录
  • Web服务器如何处理HTTP POST [关闭]
  • 将语言数组设置为常量

Copyright ©2022 我爱占星 All Rights Reserved.

浙ICP备2022030071号-1

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

友情链接:代码精华