In php, Number of rows and columns in a 2 D array?

后端 未结 6 1884
野性不改
野性不改 2021-01-07 04:38

I have a two dimensional array with unknown number of elements.

$two_darray[row][column]; //there will be an unknown integer values instead of row and column

6条回答
  •  孤街浪徒
    2021-01-07 04:50

    For a php Multidimensional Array, Use

    $rowSize = count( $arrayName );
    $columnSize = max( array_map('count', $arrayName) );
    

提交回复
热议问题