duanfa2014 2013-03-08 19:02
浏览 5

如何从数组数组中获取数组(PHP)

I am receiving this when i use print_r:

Array ( 
    [0] => 15 
    [1] => 15 
    [2] => 15 
    [3] => 15 
    [4] => 15 
    [5] => 16 
    [6] => 15 
    [7] => 15 
    [8] => 15 
    [9] => 14 
    ... and so on ... 
)

and I was wondering how I can get an array of these second values (i.e.):

$newArray = array(15,15,15,15,15,16,15,15,15,14, ... );

I have tried using array_values but to no avail!

As a background, I got these results from a single column in my database and am now trying to plot them using HighRoller/HighCharts.

Thanks for the help!

  • 写回答

3条回答 默认 最新

  • dsaob80228 2013-03-08 19:05
    关注

    You don't have an array of arrays. You have an array of values with numeric indexes. Unless I am totally misunderstanding your question ....

    Array ( 
        [0] => 15 
        [1] => 15 
        [2] => 15 
        [3] => 15 
        [4] => 15 
        [5] => 16 
        [6] => 15 
        [7] => 15 
        [8] => 15 
        [9] => 14 
        ... and so on ... 
    )
    

    This means your array at index 0 has value 15 and so on.

    评论

报告相同问题?

悬赏问题

  • ¥15 51单片机中C语言怎么做到下面类似的功能的函数(相关搜索:c语言)
  • ¥15 seatunnel 怎么配置Elasticsearch
  • ¥15 PSCAD安装问题 ERROR: Visual Studio 2013, 2015, 2017 or 2019 is not found in the system.
  • ¥15 (标签-MATLAB|关键词-多址)
  • ¥15 关于#MATLAB#的问题,如何解决?(相关搜索:信噪比,系统容量)
  • ¥500 52810做蓝牙接受端
  • ¥15 基于PLC的三轴机械手程序
  • ¥15 多址通信方式的抗噪声性能和系统容量对比
  • ¥15 winform的chart曲线生成时有凸起
  • ¥15 msix packaging tool打包问题