<?php
Array("Nome"=>"Rodrigo","CPF"=>"123456789-00","Cargo"=>"Abestado"), Array("Nome"=>"Maria","CPF"=>"987654321-00","Cargo"=>"Abestada") );
Array("CPF"=>"123456789-00","Titulo de Eleitor"=>"456789123"), Array("CPF"=>"987654321-00","Titulo de Eleitor"=>"987564123") );
foreach($array2 as $valor){
$chave = $valor["CPF"];
$arrayChaves[$chave] = $valor;
unset($arrayChaves[$chave]["CPF"]); }
foreach($array1 as $pessoa){
$cpfPessoa = $pessoa["CPF"];
if (isset($arrayChaves[$cpfPessoa])){ $arrayFinal[] = array_merge($pessoa, $arrayChaves[$cpfPessoa]); }
}
PD9waHAKCiRhcnJheTEgPSBBcnJheSgKICAgIEFycmF5KCJOb21lIj0+IlJvZHJpZ28iLCJDUEYiPT4iMTIzNDU2Nzg5LTAwIiwiQ2FyZ28iPT4iQWJlc3RhZG8iKSwKICAgIEFycmF5KCJOb21lIj0+Ik1hcmlhIiwiQ1BGIj0+Ijk4NzY1NDMyMS0wMCIsIkNhcmdvIj0+IkFiZXN0YWRhIikKKTsKCiRhcnJheTIgPSBBcnJheSgKCUFycmF5KCJDUEYiPT4iMTIzNDU2Nzg5LTAwIiwiVGl0dWxvIGRlIEVsZWl0b3IiPT4iNDU2Nzg5MTIzIiksCglBcnJheSgiQ1BGIj0+Ijk4NzY1NDMyMS0wMCIsIlRpdHVsbyBkZSBFbGVpdG9yIj0+Ijk4NzU2NDEyMyIpCik7CgokYXJyYXlDaGF2ZXMgPSBBcnJheSgpOwpmb3JlYWNoKCRhcnJheTIgYXMgJHZhbG9yKXsKCSRjaGF2ZSA9ICR2YWxvclsiQ1BGIl07CgkkYXJyYXlDaGF2ZXNbJGNoYXZlXSA9ICR2YWxvcjsKCXVuc2V0KCRhcnJheUNoYXZlc1skY2hhdmVdWyJDUEYiXSk7Cn0KCiRhcnJheUZpbmFsID0gQXJyYXkoKTsKZm9yZWFjaCgkYXJyYXkxIGFzICRwZXNzb2EpewoJJGNwZlBlc3NvYSA9ICRwZXNzb2FbIkNQRiJdOwoJaWYgKGlzc2V0KCRhcnJheUNoYXZlc1skY3BmUGVzc29hXSkpewoJCSRhcnJheUZpbmFsW10gPSBhcnJheV9tZXJnZSgkcGVzc29hLCAkYXJyYXlDaGF2ZXNbJGNwZlBlc3NvYV0pOwoJfQp9CgpwcmludF9yKCRhcnJheUZpbmFsKTs=