I need help with some PHP code. I am retrieving data from a MySQL database using left joins. Based on these records I am creating nested arrays which I want to be clean, e.g.:
array(
[0] = array(
[0] = array(
[0] = array(
[0] = array(
etc...
)
)
),
[1] = array(
[0] = array(
[0] = array(
[0] = array(
etc...
)
)
)
)
)
Now my idea is to create multiple arrays and then use the key to match them together, e.g.:
$array1 = array([0] => array(id = 0)); // value =
// match
$array2 = array([0] => array(...)); // key = id = value of the $array1 with key 0
Is it a good practice ? Or should I keep the nested arrays ?