-2
$celulas = array (
0 => array ("idCelula" => 17,"nomeCelula" => "Célula 1" ),
1 => array ("idCelula" => 18,"nomeCelula" => "Célula 2" )
);
foreach ( $celulas as $celula ) {
$celulasPesquisa = null;
$celulasReunioes = array (
0 => array ("idCelula" => 17,"diaReuniao" => 5)
);
array_push ( $celula, $celulasReunioes );
}
print_r($celulas);
Man goal is that for each $celula
of array $celulas
be it added one array $celulasReunioes
who brings the meetings that cell.
Namely that the array
final $celulas
stay that way:
$celulas = array (
0 => array (
"idCelula" => 17,
"nomeCelula" => "Célula 1",
array ( 0 => array ("idCelula" => 17,"diaReuniao" => 5)
1 => array (
"idCelula" => 18,
"nomeCelula" => "Célula 2",
array ( 0 => array ("idCelula" => 18,"diaReuniao" => 12)
);
What needs to be done?
'Cause the way I’m doing it’s not working!
Detail, I tried to create a minimal example according to orientation.
The way it is,
print_ ( $celulas );
prints:
$celulas = array (
0 => array ("idCelula" => 17,"nomeCelula" => "Célula 1" ),
1 => array ("idCelula" => 18,"nomeCelula" => "Célula 2" )
);
That is, without the addition of foreach
Man, what a mess! Your goal final all right desstructured...
– LipESprY
all right, kkk, but I’m already taking care of this mess... thanks
– Carlos Rocha