I have this two arrays:
Array
(
[InterfacedaRequisicaodePagamento] => Array
(
[0] => Array
(
[SequenciadoRegistro] => 15015
[CodigodaContadoDocumento] =>
)
)
)
and
Array
(
[InterfaceGrupoRequisicaodePagamento] => Array
(
[0] => Array
(
[CodigodoProjeto] =>
)
)
)
What I need is to insert the second array after the CodigodaContadoDocumento item of the first array to make a JSON string, but array_push don't work for it, and I don't know how to use array_splice in this case.
I'm using
array_push($interfaceRequisicaoPagamento, $interfaceGrupoRequisicaodePagamento);
and the result is the following:
Array (
[InterfacedaRequisicaodePagamento] => Array (
[0] => Array (
[SequenciadoRegistro] => 15015
[CodigodaContadoDocumento] =>
)
)
[0] => Array (
[InterfaceGrupoRequisicaodePagamento] => Array (
[0] => Array (
[CodigodoProjeto] =>
)
)
)
)
But what I need is:
Array
(
[InterfacedaRequisicaodePagamento] => Array
(
[0] => Array
(
[SequenciadoRegistro] => 15015
[CodigodaContadoDocumento] =>
[InterfaceGrupoRequisicaodePagamento] => Array
(
[0] => Array
(
[CodigodoProjeto] =>
)
)
)
)
)
array_push()should work just fine.array_push($interfaceRequisicaoPagamento, $interfaceGrupoRequisicaodePagamento);, and the result is the following: Array ( [InterfacedaRequisicaodePagamento] => Array ( [0] => Array ( [SequenciadoRegistro] => 15015 [CodigodaContadoDocumento] => ) ) [0] => Array ( [InterfaceGrupoRequisicaodePagamento] => Array ( [0] => Array ( [CodigodoProjeto] => ) ) ) )