注意:未定义的偏移量:C中为0:

    /* the result of print_r($_POST['select']); :
    Array
    (
        [7_222] => 5
        [7_333] => 4
        [7_444] => 5
        [8_222] => 3
        [8_333] => 5
        [8_444] => 2
        [9_222] => 5
        [9_333] => 3
        [9_444] => 1
    )*/
    foreach($_POST['select'] as $k => $v) {
        $k=explode('_',$k);
        $row=$k[0];
        $column=$k[1];
        $matrix[$row][$column]=$v;
    }
    $cb = count($matrix);
    $ck = isset($matrix[$row])?count($matrix[$column]):0;

    for($row1=0;$row1$matrix[$row2][$column]) {
                        $k[]='k'.($column+1);
                    }
                }
                echo implode(',',$k).'
'; } } }

Notice: Undefined offset: 0 in C:

how to solve this problem?

for($row1=0;$row1$matrix[$row2][$column]) { is that valid syntax. In fact it makes no sense.

A for loop has the following structure:

for (expr1; expr2; expr3) {
    statement
}

for ($i = 1; $i <= 10; $i++) {
    echo $i;
}

I cannot offer you an alternative syntax as your current code doesn't offer enough clues to propose a solution.