Multi-Dimensional array count in PHP

后端 未结 7 1601
感情败类
感情败类 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:49

    To count total number of Ticket, this bellow code will help you for PHP.

    foreach($mainArray as $Array){
        foreach($Array as $perTicke){
            $count++;
        }
    }
    $total_ticket = $count;
    

提交回复
热议问题