I have a one dimensional array which looks like this:
$table = array("rnbqkbnr",
"pppppppp",
"00000000",
"00000000",
"00000000",
"00000000",
"00000000",
"PPPPPPPP",
"RNBQKBNR" );
What I want to do is make that array a two dimensional, each element to be an array on it's own, so I can access every letter.
Something like this:
$arr= array(
array("r", "n", "b", "q", "k", "b", "n", "r"),
array("p", "p", "p", "p", "p", "p", "p", "p"),
array("0", "0", "0", "0", "0", "0", "0", "0"),
array("0", "0", "0", "0", "0", "0", "0", "0"),
array("0", "0", "0", "0", "0", "0", "0", "0"),
array("0", "0", "0", "0", "0", "0", "0", "0"),
array("P", "P", "P", "P", "P", "P", "P", "P"),
array("R", "N", "B", "Q", "K", "B", "N", "R")
);
I tried different finctions like str_split(), or array_chunk(), or explode(), but everytime I end up getting the first function ($table) which is one dimensional and I can't acces every element separately.
Every help is appreciated :)