Concept

How can two indices be used to set values in a two-dimensional PHP array?

ComputerScienceOne / Multidimensional Arrays

"Alternatively, you can use two indices to get and set values from a 2-dimensional array.\n\nfor($i=0; $i<3; $i++) {\n\nfor($j=0; $j<4; $j++) {\n\n$mat[$i][$j] = ($i+$j)*3;\n\n}\n\n}\n\nwhich results in:\n\nArray (\n\n[0] => Array ( [0] => 0 [1] => 3 [2] => 6 [3] => 9 )\n\n[1] => Array ( [0] => 3 [1] => 6 [2] => 9 [3] => 12 )\n\n[2] => Array ( [0] => 6 [1] => 9 [2] => 12 [3] => 15 )\n\n)"

Related Ideas

How can two indices be used to set values in a two-dimensional PHP array? | ComputerScienceOne | Bifalgorithm | Bifalgorithm