I'm working with arrays, which has as an index the code of the person, this person example:
[PER0076] => Array
(
[fecha_registro] => 2018-03-27 09:52:31.642576
[codigo_persona] => PER0076
[cedula_ubicacion] => 0814030010000001
[codigo_estado] => 08
[nombre_estado] => CARABOBO
[codigo_municipio] => 14
[nombre_municipio] => VALENCIA
[codigo_parroquia] => 03
[nombre_parroquia] => URBANA MIGUEL PEÑA
[codigo_sector] => 001
[nombre_sector] => BRISAS DEL ARENAL
[fecha_abordaje] => 2018-03-02
[codigo_origen] => 1
[origen] => Plan Vulnerabilidad
[nombres_apellidos] => RAMON FERNANDEZ
[cedula] => 2837999
[fecha_nacimiento] => 1942-05-22
[edad] => 75
[meses] => 9
[dias] => 8
[genero] => 1
[embarazo] => 2
[cbi] => 220
[peso] => 52.7
[talla] => 1.62
[descripcion_situacion] => 1
)
and this other one
[PER0076] => Array
(
[fecha_registro] => 2018-03-27 09:52:31.642576
[codigo_persona] => PER0076
[cedula_ubicacion] => 0814030010000001
[codigo_estado] => 08
[nombre_estado] => CARABOBO
[codigo_municipio] => 14
[nombre_municipio] => VALENCIA
[codigo_parroquia] => 03
[nombre_parroquia] => URBANA MIGUEL PEÑA
[codigo_sector] => 001
[nombre_sector] => BRISAS DEL ARENAL
[fecha_abordaje] => 2018-03-02
[codigo_origen] => 1
[origen] => Plan Vulnerabilidad
[nombres_apellidos] => RAMON FERNANDEZ
[cedula] => 2837999
[fecha_nacimiento] => 1942-05-22
[edad] => 75
[meses] => 9
[dias] => 8
[genero] => 1
[embarazo] => 2
[cbi] => 230
[peso] => 58.2
[talla] => 1.62
[descripcion_situacion] => 1
)
What I would like to know is how to put these two arrays into a single one where the index is the code of the person, or how you could verify if the code of the person already exists from the second only take the values from the IWC at last