I have these values:
$x[0][0] = 1;
$x[0][1] = 2;
$x[0][2] = 3;
$x[1][0] = 4;
$x[1][1] = 5;
$x[1][2] = 6;
$x[2][0] = 7;
$x[2][1] = 8;
$x[2][2] = 9;
Now, i need to make an autonomous array. Basically, it will change with the dimension. For example a 4*4 and not a 3*3.
$arr= array(
0=>array($x[0][0],$x[0][1],$x[0][2]),
1=>array($x[1][0],$x[1][1],$x[1][2]),
2=>array($x[2][0],$x[2][1],$x[2][2])
)
I am trying a for loop, but without success. Any idea?