I started an array ($ arrDados = array ();) and now I need to add information (array_push) so that I can access the information later as follows:
colA1 = $arrDados['NumeroEmpenhoAno']['code'];
colA2 = $arrDados['NumeroEmpenhoAno']['size'];
colB1 = $arrDados['UnidadeOrc']['code'];
colB2 = $arrDados['UnidadeOrc']['size'];
What would be the array_push code for accessing this array in the above structure?
I'm trying the code below, but it's wrong:
$arrDados=array();
array_push($arrDados,array('NumeroEmpenhoAno' => array('code' => 0,'size' => 1)));
array_push($arrDados,array('UnidadeOrc' => array('code' => 1,'size' => 2)));
The way I'm doing, I'm having to access it as follows:
colA1 = $arrDados[0]['NumeroEmpenhoAno']['code'];
But I want to:
colA1 = $arrDados['NumeroEmpenhoAno']['code'];
That is, without indexes.