Multi-Dimensional array count in PHP

后端 未结 7 1597
感情败类
感情败类 2020-12-20 11:16

I have a multi-dimentional array set up as follows

array() {
    [\"type1\"] =>
    array() {
        [\"ticket1\"] =>
        array(9) { 
                    


        
相关标签:
7条回答
  • 2020-12-20 11:55

    The easiest way to do this is one simple foreach loop:

    $count = 0;
    foreach( $tickets as $ticketType){
        $count += count( $ticketType);
    }
    
    0 讨论(0)
提交回复
热议问题