简体   繁体   English

访问数组时不显示数组结果,如何访问此数组中的特定字段值

[英]Array results are not displayed when I am accessing the array,How can I access specific field values in this array

Array ( [0] => 
    Array ( 
      [Bounces] => 1 
      [Complaints] => 0 
      [DeliveryAttempts] => 405 
      [Rejects] => 0 
      [Timestamp] => 2014-11-07T11:47:00Z ) 

        [1] => etc etc
        // Multiple array values are here
     );

Its a simple multidimensional array. 它是一个简单的多维数组。

Just do this.. 就是这样

 foreach($yourArray as $val){
     foreach($val as $v){
            echo $v['Bounces']."<br>";
            echo $v['Complaints']."<br>"; // etc etc
     }

 }

Or if you want to just get values directly without looping 或者,如果您只想直接获取值而不循环

 $yourArray[0]['Complaints']; // Complaints attribute of 1st array entry
 $yourArray[1]['Bounces']; // Bounce attribute of 2nd array entry
 $yourArray[4]['Rejects']; //Rejects attribute of 5th array entry

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 我如何只访问此PHP数组中的特定数组值 - how do I access only specific array values in this PHP array PHP-如何访问嵌套数组中的特定数组值? - PHP - How do I access specific array values in nested array? 如何在数组中搜索特定值? - How can I search an array for specific values? 数组键为数字时如何调用特定数组 - How can I call specific array when the array keys are numbers 我正在显示多维数组的值。 正在显示值,但我收到未定义偏移量的通知 - I am displaying the values of a multidimensional array. The values are being displayed but i am getting a notice of Undefined offset 通过foreach循环显示值数组,如何限制要显示的数组? - Displaying an array of values via foreach loop and how can I limit the array to be displayed? 显示数组时,我遇到了不在数组中的重复值 - When displaying array, I am having repeated values that are not in the array 如何从多个复选框帖子值中对结果进行排列? - How can I array results from multiple checkbox post values? 如何通过定义特定键来访问php嵌套数组中的所有值? - How can i access all values within a nested array in php by defining a specific key? 如何使用变量变量访问关联数组的特定深度 - How can I access a specific depth of an associative array with variable variables
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM