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

PHP数组访问数组对象的标题名称

I am trying to get the title name of an array object.

For example I have

$results[0]['page']
$results[0]['title']

I was wondering if I could use a for loop to loop through the $results[0] array and get the 'page' and 'title' names and insert them into a new array?

Thanks for your time

foreach ($results[0] as $key=>$value) {
     //Your key will be page and title, and then the value will be in value
}

More information on the PHP documentation for foreach().

Or you could just use array_keys() to turn the assoc indexes into a new array automatically.

近期文章

  • python脚本问题.
  • 大量重绘窗口时,如何避免 Win32 控件闪烁?
  • 如何在登录界面切换用户window11系统
  • java报错Cannot parse null string
  • 芯片制造转后端设计可行吗?需要读研或参加培训班吗?
  • 数组传入函数后不能正确利用sizeof(arr)/ sizeof (arr[0]) 计算长度
  • 安装cnpm,出现以下图片中的问题
  • c语言有关判断质数问题
  • 试图在另一个div之前移动一个div而不搞砸我不明白的PHP :)
  • 有关sql查询命令的错误
  • cron每隔50秒怎么写?
  • 围圈报数新生军训问题
  • Yum和 Dpkg 都not found怎么办
  • pip更新失败。。。。
  • 请求大神解决,不会做太难
  • pdf转docx内容有误
  • 函数c调用错误(可能是二维数组问题?)
  • 使用错误输入初始化类使其无法使用但对象仍然存在
  • cnmp安装问题,求解,老是报错
  • Java web prodjectDao

Copyright ©2022 我爱占星 All Rights Reserved.

浙ICP备2022030071号-1

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

友情链接:代码精华